I hope somebody can give me some insight here...
I've been looking at Comanche (and PWS). The basic job of these is to: (1) listen on a TCP/IP port for http requests, and then (2) respond to the request by answering back a stream of html text. This is, of course, the classic "http server" duty.
However, I don't know how to do the opposite. That is, compose an http 'POST' request, and send it off to another server. In other words, I don't want to respond to an incoming request, but instead be the originator of a request to another system.
Does anybody have any sample code for this?
Thanks,
Nevin
On Sunday 28 April 2002 09:42 pm, Nevin Pratt wrote:
I hope somebody can give me some insight here...
I've been looking at Comanche (and PWS). The basic job of these is to: (1) listen on a TCP/IP port for http requests, and then (2) respond to the request by answering back a stream of html text. This is, of course, the classic "http server" duty.
However, I don't know how to do the opposite. That is, compose an http 'POST' request, and send it off to another server. In other words, I don't want to respond to an incoming request, but instead be the originator of a request to another system.
Does anybody have any sample code for this?
You might want to look at the HTTPClient class methods that have httpPost in their names.
Nevin Pratt wrote:
However, I don't know how to do the opposite. That is, compose an http 'POST' request, and send it off to another server. In other words, I don't want to respond to an incoming request, but instead be the originator of a request to another system.
Does anybody have any sample code for this?
In the current implementation there are two ways to issue requests, depending wether you run Squeak as a plugin in a web browser or standalone. HTTPClient tries to transparently provide these services (get, post), but the complete variants are still implemented by class HTTPSocket. There are a few example methods, but you can always look for senders to see what other people do :-)
Michael
squeak-dev@lists.squeakfoundation.org