Binary in an http request

Lex Spoon lex at cc.gatech.edu
Wed Jun 12 16:05:03 UTC 2002


Bergel Alexandre <bergel at iam.unibe.ch> wrote:
> Hello,
> 
> How could I send some objects (let's say an imagesegment :-) to a serveur http (ie : Comanche) ?
> I suppose I have to get a ByteArray, and then to encode it with a 7bit protocol...
> 

You could use HTTPSocket's various post commands.  They will do all the
encoding for you -- you just create a dictionary mapping names to data. 
It normally expects strings for the data, not ByteArrays.

The "postMultipart" variant is likely to be the fastest, but it's also
the hardest to support on the web server.  multipart posts are used to
upload files to Swikis.


-Lex



More information about the Squeak-dev mailing list