Log In
Developer Network
Technologies
Join the Network
Member Services
Events & Community
Voice Gateway API (VGAPI) Developer Center
Overview
Documentation
Community
Testing
Message Boards Home
Recent Posts
Statistics
Answer
(
Unmark
)
Mark as an Answer
« Back to TCL-API
formatQuery in http and httpios package
Threads [
Previous
|
Next
]
Grant Bagdasarian
Posts:
52
Join Date:
6/19/10
Recent Posts
formatQuery in http and httpios package
httpios
http
string encoding
formatquery
Answer
3/9/12 7:45 AM
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Hello,
Does somone know why the implementation of formatQuery in the httpios package is different from the one in http?
I'm trying to encode the following string(this is created by a tcl proc): {"StartTime":"2012-03-02 12:35:37"}. When I use a TCL interperter like ActiveTCL on windows and execute the following statement in tclsh85:
puts [http::formatQuery key {"StartTime":"2012-03-02 12:35:37"}]
. The output is
key=%22StartTime%22%3a%222012-03-02%2012%3a35%3a37%22
. This is exactly what I need. But formatQuery in httpios for some reason does not replace a space with %20.
I have two problems:
1) Cisco does not recognize the http package. So I'm not able to use the standard formatQuery.
2) The formatQuery in httpios does not do the same as formatQuery in http, as it does not encode the space to %20.
I have a proc which creates a datetime string, but atm I'm forced to replace the space with "%20" which I shouldnt have to do imo. FormatQuery should take care of this.
proc now { } {
set systemTime [clock seconds]
set datestamp [clock format $systemTime -format %Y-%m-%d]
set timestamp [clock format $systemTime -format %H:%M:%S]
return [append t $datestamp "%20" $timestamp]
}
What should I do?
Thanks,
Grant
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Grant Bagdasarian
Posts:
52
Join Date:
6/19/10
Recent Posts
RE: formatQuery in http and httpios package
Answer
3/5/12 11:19 AM as a reply to Grant Bagdasarian.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
I created my own solution for this using regsub to replace spaces with %20.
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top