how to parse HTTP Post data

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to parse HTTP Post data

squeakman
Hello,

I am reading an incoming HTTP post from a socket.  The data I am
receiving looks like:

'POST / HTTP/1.1
Host: localhost
Content-type: application/x-www-form-urlencoded
Connection: Keep-Alive
Content-length: 72


status=001&transID=119&serialNo=123&refID=456&destNo=6399999&prodCode=SM'


I want to be get at the form data in the HTTP Request.

I can parse the data "by hand" but I suspect that there is already code
that does this.  How could this be done?

Thanks,
Frank

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: how to parse HTTP Post data

Kogan, Tamara
(HttpResponse readFrom: 'POST / HTTP/1.1
Host: localhost
Content-type: application/x-www-form-urlencoded
Connection: Keep-Alive
Content-length: 72

status=001&transID=119&serialNo=123&refID=456&destNo=6399999&prodCode=SM
' readStream) formData

HTH,
Tamara Kogan
Smalltalk Development
Cincom Systems

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of squeakman
Sent: Friday, August 17, 2012 9:19 AM
To: [hidden email]
Subject: [vwnc] how to parse HTTP Post data

Hello,

I am reading an incoming HTTP post from a socket.  The data I am
receiving looks like:

'POST / HTTP/1.1
Host: localhost
Content-type: application/x-www-form-urlencoded
Connection: Keep-Alive
Content-length: 72


status=001&transID=119&serialNo=123&refID=456&destNo=6399999&prodCode=SM
'


I want to be get at the form data in the HTTP Request.

I can parse the data "by hand" but I suspect that there is already code
that does this.  How could this be done?

Thanks,
Frank

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: how to parse HTTP Post data

Peter Hunsberger
In reply to this post by squeakman
This may  depend on the server you are running but look at the webRequest queryData nameValueDictionary.

You should get a Dictionary of Collections (since any request parameter may occur more than once).

Peter Hunsberger


On Fri, Aug 17, 2012 at 8:19 AM, squeakman <[hidden email]> wrote:
Hello,

I am reading an incoming HTTP post from a socket.  The data I am
receiving looks like:

'POST / HTTP/1.1
Host: localhost
Content-type: application/x-www-form-urlencoded
Connection: Keep-Alive
Content-length: 72


status=001&transID=119&serialNo=123&refID=456&destNo=6399999&prodCode=SM'


I want to be get at the form data in the HTTP Request.

I can parse the data "by hand" but I suspect that there is already code
that does this.  How could this be done?

Thanks,
Frank

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc