Prev: does exist a "one-file" tclxml, tcldom, etc. version for starkit'ting/starpack'aging?
Next: mql command error on tcl.
From: siva on 11 Jan 2010 09:14 Hi, TclCurl package is now working while performing HTTP POST and the snapshot is captured here for your reference. How to resolve this issue? -bash-3.00$ tclsh % set httpHeaders "Content-Length:0 Authorization: Basic xxxxxxxxxxxxxxx" Content-Length:0 Authorization: Basic Z2FsZTpnYWxlMTIz % set url "https://express2.bluelock.com/api/v0.8/login" https://express2.bluelock.com/api/v0.8/login % package req TclCurl 7.19.0 % set response [::curl::transfer -url $url -httpheader $httpHeaders - headervar Resp_HttpHeaderCreate -bodyvar Resp_HttpBodyCreate -verbose 1 -post 1 ] * About to connect() to express2.bluelock.com port 443 (#0) * Trying 174.46.169.100... * connected * Connected to express2.bluelock.com (174.46.169.100) port 443 (#0) * successfully set certificate verify locations: * CAfile: /usr/share/ssl/certs/ca-bundle.crt CApath: none * SSL connection using DHE-RSA-AES256-SHA * Server certificate: * subject: C=US; ST=Indiana; L=Indianapolis; O=BlueLock, LLC; CN=*.bluelock.com * start date: 2009-03-12 14:49:02 GMT * expire date: 2010-04-18 21:31:58 GMT * subjectAltName: express2.bluelock.com matched * issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc..; OU=http://certificates.godaddy.com/repository; CN=Go Daddy Secure Certification Authority; serialNumber=07969287 * SSL certificate verify ok. > POST /api/v0.8/login HTTP/1.1 Host: express2.bluelock.com Accept: */* Content-Length:0 Content-Type: application/x-www-form-urlencoded Then no response . ????????????????????????????????????????????? Thanks Siva
From: M. Strobel on 11 Jan 2010 09:23 siva schrieb: > Hi, > > > > TclCurl package is now working while performing HTTP POST and the > snapshot is captured here for your reference. How to resolve this > issue? > > > > > > -bash-3.00$ tclsh > > % set httpHeaders "Content-Length:0 Authorization: Basic > xxxxxxxxxxxxxxx" > > Content-Length:0 Authorization: Basic Z2FsZTpnYWxlMTIz > > % set url "https://express2.bluelock.com/api/v0.8/login" > > https://express2.bluelock.com/api/v0.8/login > > % package req TclCurl > > 7.19.0 > > % set response [::curl::transfer -url $url -httpheader $httpHeaders - > headervar Resp_HttpHeaderCreate -bodyvar Resp_HttpBodyCreate -verbose > 1 -post 1 ] > -cut- >> POST /api/v0.8/login HTTP/1.1 > > Host: express2.bluelock.com > > Accept: */* > > Content-Length:0 > > Content-Type: application/x-www-form-urlencoded > > > > Then no response -cut- > > > > Thanks > > Siva It looks like you did not send any data. Use -httppost to send data fields. /Str.
From: siva on 12 Jan 2010 05:33 On Jan 11, 7:23 pm, "M. Strobel" <sorry_no_mail_h...(a)nowhere.dee> wrote: > siva schrieb: > > > Hi, > > > TclCurl package is now working while performing HTTP POST and the > > snapshot is captured here for your reference. How to resolve this > > issue? > > > -bash-3.00$ tclsh > > > % set httpHeaders "Content-Length:0 Authorization: Basic > > xxxxxxxxxxxxxxx" > > > Content-Length:0 Authorization: Basic Z2FsZTpnYWxlMTIz > > > % set url "https://express2.bluelock.com/api/v0.8/login" > > >https://express2.bluelock.com/api/v0.8/login > > > % package req TclCurl > > > 7.19.0 > > > % set response [::curl::transfer -url $url -httpheader $httpHeaders - > > headervar Resp_HttpHeaderCreate -bodyvar Resp_HttpBodyCreate -verbose > > 1 -post 1 ] > > -cut- > >> POST /api/v0.8/login HTTP/1.1 > > > Host: express2.bluelock.com > > > Accept: */* > > > Content-Length:0 > > > Content-Type: application/x-www-form-urlencoded > > > Then no response > -cut- > > > Thanks > > > Siva > > It looks like you did not send any data. Use -httppost to send data fields. > > /Str. Thanks lot ! The same login operation is working fine with curl utility. Could you provide curl equivalent TclCurl code snippet for HTTP POST for login. Here is the curl command capture Curl ------ " curl -X POST -k -v -H "Content-Length:0" -H "Authorization: Basic Z2FsZTpnYWxlMTIz" https://express2.bluelock.com/api/v0.8/login " Note: Username and Password is added in header filed that encoded by base64. Thanks Siva
From: M. Strobel on 12 Jan 2010 09:34
siva schrieb: > On Jan 11, 7:23 pm, "M. Strobel" <sorry_no_mail_h...(a)nowhere.dee> > wrote: >> siva schrieb: >> >>> Hi, >>> TclCurl package is now working while performing HTTP POST and the >>> snapshot is captured here for your reference. How to resolve this >>> issue? >>> -bash-3.00$ tclsh >>> % set httpHeaders "Content-Length:0 Authorization: Basic >>> xxxxxxxxxxxxxxx" >>> Content-Length:0 Authorization: Basic Z2FsZTpnYWxlMTIz >>> % set url "https://express2.bluelock.com/api/v0.8/login" >>> https://express2.bluelock.com/api/v0.8/login >>> % package req TclCurl >>> 7.19.0 >>> % set response [::curl::transfer -url $url -httpheader $httpHeaders - >>> headervar Resp_HttpHeaderCreate -bodyvar Resp_HttpBodyCreate -verbose >>> 1 -post 1 ] >> -cut- >>>> POST /api/v0.8/login HTTP/1.1 >>> Host: express2.bluelock.com >>> Accept: */* >>> Content-Length:0 >>> Content-Type: application/x-www-form-urlencoded >>> Then no response >> -cut- >> >>> Thanks >>> Siva >> It looks like you did not send any data. Use -httppost to send data fields. >> >> /Str. > > Thanks lot ! > > The same login operation is working fine with curl utility. > Could you provide curl equivalent TclCurl code snippet for HTTP POST > for login. > Here is the curl command capture > > Curl > ------ > " curl -X POST -k -v -H "Content-Length:0" -H "Authorization: Basic > Z2FsZTpnYWxlMTIz" https://express2.bluelock.com/api/v0.8/login " > > Note: Username and Password is added in header filed that encoded by > base64. > > Thanks > Siva The options to do it at the call level are there, see -username -password -httpauth at http://personal1.iddeo.es/andresgarci/tclcurl/english/docs.html Are you aware that http basic auth has no login? Username and password are sent with every request. It looks strange when posting to a login subdirectory with basic auth. /Str. |