Code Comments
Programming Forum and web based access to our favorite programming groups.Can I use ::curl::transfer to send a file to a Web Server and get a response from that Web Server? For example I have an XML file that I wish to send to an asp application, i.e, http://10.10.20.11/hisap.asp. The web server then returns an Acknowledgement message indicating whether he was happy with the message or not. Something like: ::curl::transfer -url http://10.10.20.11/hisap.asp -file myfile returns 0. I need the response from the remote application. On the same subject, do I have to send it as a file or can I send it as a buffer from within my Tcl script? Any help is appreciated
Post Follow-up to this messagecharlie.bursell@quovadx.com (Charlie Bursell) wrote in message news:<ac45e772.0410200655.39 a42a93@posting.google.com>... > Can I use ::curl::transfer to send a file to a Web Server and get a > response from that Web Server? I am guessing the asp app will expect the file to be sent as if you had been in a web page with a form and a submit button, in that case you need to do something like this: set fileContent "This is what we will send as if it was the content of a fil e" curl::transfer -url http://10.10.20.11/hisap.asp -bodyvar ack -post 1 -httppost [list name "name" bufferName noFile.txt \ buffer $fileContent contenttype "text/plain"] -httppost [list name "submit" contents "send"] puts "Server acknowledgment:" puts $ack
Post Follow-up to this messagefandom@retemail.es (Andres Garcia) wrote in message news:<5d6e9670.0410210446.724ff95@posti ng.google.com>... > charlie.bursell@quovadx.com (Charlie Bursell) wrote in message news:<ac45e 772.0410200655.39a42a93@posting.google.com>... > > I am guessing the asp app will expect the file to be sent > as if you had been in a web page with a form and a submit > button, in that case you need to do something like this: > > > set fileContent "This is what we will send as if it was the content of a f ile" > > curl::transfer -url http://10.10.20.11/hisap.asp -bodyvar ack -post 1 > -httppost [list name "name" bufferName noFile.txt \ > buffer $fileContent contenttype "text/plain"] > -httppost [list name "submit" contents "send"] > > puts "Server acknowledgment:" > puts $ack Actually, believe it or not, they just want the message (XML) and they will then send back a response (XML). Perhaps -bodyvar is what I need. I had attempted to use -writeproc. That works well as long as everything is at the global level. But as soon as I try to work inside a namespace, I get the message "Failed writing body". Thank you for your help
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.