Login  
Search All Forums
Dart Home | PowerTCP Web for ActiveX | Custom Development Reply | PowerTCP Web for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web for ActiveX
Topic: Post request with message body
User1308

Posts: 3
Member Since: 06/08/00
posted June 8, 2000 3:39 PM

is it possible to send a POST request with some
data in the HTTP request message body to
a web application?
i'm using Web Tool?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted June 8, 2000 3:58 PM

Yes. See the Post sample.
User1308

Posts: 3
Member Since: 06/08/00
posted June 8, 2000 4:07 PM


thanks for the help. i checked out the post
sample program.  however, if i were to send
the following http request:

POST /cgi-bin/test?action=submit HTTP/1.0\n
Content-Type: text/xml;charset=UTF-8\n
Content-Length: 10\n
\n" +
abcdefghij

can i do that with WebTool? if so, where should
the data string "action=submit" and
"abcdefghij" go?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted June 8, 2000 4:24 PM


Is that request generated by something?
Why do you feel that's what the request should look like?

User1308

Posts: 3
Member Since: 06/08/00
posted June 8, 2000 4:57 PM


the message is HTTP compliant, i.e., i can
directly open a socket to the web server,
write the request as is and the server will
return some results.

gary

Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted June 8, 2000 5:14 PM

Try this:

  Http1.Timeout = 10000
  Http1.Url = "hostname/cgi-bin/test?action=submit"
  Dim Header As New DartStrings
  Header.Add "Content-Type: text/xml;charset=UTF-8"
  Http1.Post "abcdefghij", Header

Where hostname is your site.

User1111

Posts: 2
Member Since: 10/19/00
posted October 19, 2000 4:34 PM

I tried to use the example from the message above but I am not able to get it to work.
In my case the code looks like this

Http1.Url = "hostname/cgi-bin/test.asp"
Dim Header As New DartStrings
Header.Add "Content-Type: application/x-www-form-urlencoded\n SOAPAction: Hello\n"
Http1.Post "abcdefghij", Header
When I post this information to the server the header information is not getting posted. On the server I check for Request.ServerVariables("HTTP_SOAPACTION") and it returns me nothing. 

Please help.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 19, 2000 4:42 PM


That's beacuse you are trying to use \n in VB, which doesn't do what you want it to do. Try this instead:

Header.Add "Content-Type: application/x-www-form-urlencoded"
Header.Add "SOAPAction: Hello"
User1111

Posts: 2
Member Since: 10/19/00
posted October 19, 2000 6:21 PM

Thanks, it did work.
Reply | PowerTCP Web for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX