I had noticed this problem already long time ago but I was hoping it would get fixed in subsequent releases.
However it still exists in 15.0(1)M4. It causes a serious issue, preventing us from completing an application (We are Cisco Registered Developer).
The problem is that when -query is used with 'httpios geturl', custom headers are
NOT sent to the server. This prevents from using POST and Authorization, that is
indispensable for our application to work. I have not found any evidence indicating that one can not set custom headers in TCL http POST.
Test code:
proc act_Setup {} {
set query {Test Body}
set hdr {Authorization {Basic uuuuu:pppp} Custom XXX}
set url
http://10.0.1.128:8000/post.cgi ::httpios::geturl $url -headers $hdr -command httpCallback -query $query
}
proc httpCallback {token} {
puts -nonewline "Status: [::httpios::status $token]"
::httpios::cleanup $token
call close
}
package require httpios 1.0
set fsm(INIT,ev_handoff) "act_Setup same_state"
fsm define fsm INIT
Debug output:
Jan 19 18:36:39.704 CET: //4256//PACK:/tcl_httpiosGeturlObjCmd: ::httpios::geturl
http://10.0.1.128:8000/post.cgi -headers Authorization {Basic uuuuu:pppp} Custom XXX -command httpCallback -query Test Body
Jan 19 18:36:39.708 CET: //4256//PACK:/tcl_httpiosGeturlObjCmd: Current NS: ::
Jan 19 18:36:39.708 CET: //4256//PACK:/tcl_httpiosGeturlObjCmd: URL:
http://10.0.1.128:8000/post.cgiJan 19 18:36:39.708 CET: //-1//PACK:/httpios_get_custom_headers: No Of Headers: 4
Jan 19 18:36:39.708 CET: //-1//PACK:/httpios_get_custom_headers: Authorization: Basic uuuuu:pppp
Custom: XXX
Received by server:
POST /post.cgi HTTP/1.1
Host: 10.0.1.128:8000
Content-Length: 9
Content-Type: application/x-www-form-urlencoded
Connection: close
Accept: text/vxml, text/x-vxml, application/vxml, application/x-vxml, application/voicexml, application/x-voicexml, text/plain, text/html, audio/basic, audio/wav, multipart/form-data, application/octet-stream
User-Agent: Cisco-IOS-C2801/15.0
Test Body
Again, when using GET operation, there is no problem and custom header are correctly sent, allowing authorization to work.