formatQuery in http and httpios package

Version 1
    This document was generated from CDN thread

    Created by: Grant Bagdasarian on 02-03-2012 06:50:51 AM
    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

    Subject: RE: formatQuery in http and httpios package
    Replied by: Grant Bagdasarian on 05-03-2012 05:19:58 AM
    I created my own solution for this using regsub to replace spaces with %20.