How can I get POST data?

View: New views
2 Messages — Rating Filter:   Alert me  

How can I get POST data?

by Ulrich Schöbel-2 :: Rate this Message:

| View Threaded | Show Only this Message

Hi all,

I need to process POST requests with POST data in a weird format,
subject to a separate parser. Question is: How can I get hold of the
*unparsed*, raw POST data as it comes in?

There is no need to use dispatch, so its formdata parsing is out of
the way. It wouldn't work anyway, as the incoming mime type is not
"application/x-www-form-urlencoded" (don't know yet, probably "text/plain").
The simplest way, [read [web::request -channel]] raises an error.

All this is easy with a simple CGI script, but I don't want to fork when
I have mod_websh at hand.

I'm using mod_websh (3.6.0b4) in Apache 2.2.4, if that's relevant.

Any hints, tips, tricks are warmly welcome.

Kind regards

Ulrich

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@...
For additional commands, e-mail: websh-dev-help@...


Re: How can I get POST data?

by Ronnie Brunner :: Rate this Message:

| View Threaded | Show Only this Message

Hi Ulrich

> I need to process POST requests with POST data in a weird format,
> subject to a separate parser. Question is: How can I get hold of the
> *unparsed*, raw POST data as it comes in?
>
> There is no need to use dispatch, so its formdata parsing is out of
> the way. It wouldn't work anyway, as the incoming mime type is not
> "application/x-www-form-urlencoded" (don't know yet, probably "text/plain").
> The simplest way, [read [web::request -channel]] raises an error.

For me this works:

  [read [web::request -channel] [web::request CONTENT_LENGTH]]

(Note that I tried this within a web::command dispatched using
[web::dispatch -postdata ""] to avoid parsing of the post data by Websh.)

If that doesn't work: what's your specific error?

Regards
Ronnie
--
Meet us at Jazoon'07: 24 - 28 June - http://jazoon.com

Ronnie Brunner | ronnie.brunner@...
phone +41 (0)44 247 79 79 | fax +41 (0)44 247 70 75
Netcetera AG | 8040 Zürich | Switzerland | http://netcetera.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@...
For additional commands, e-mail: websh-dev-help@...