Accessing POST parameters from BaseHTTPServer

J

James

Hi all,
I'm writing a super simple little debugging HTTP server which simply
returns the path and parameters it receives requests for.

E.g. requesting /meth?a=b returns something like:
Command: GET
Path: /meth
Params: {'a': ['b']}

This is fine for GET, but I can't see how I access parameters passed
by POST requests...

The particular client programme I'm testing will be passing stuff up
as text/xml, if that's any help...

Thanks!
James
 
S

Steve Holden

James said:
Hi all,
I'm writing a super simple little debugging HTTP server which simply
returns the path and parameters it receives requests for.

E.g. requesting /meth?a=b returns something like:
Command: GET
Path: /meth
Params: {'a': ['b']}

This is fine for GET, but I can't see how I access parameters passed
by POST requests...

The particular client programme I'm testing will be passing stuff up
as text/xml, if that's any help...
You read the standard input and decode them according to the relevant
RFC. The source of the cgi module could be enlightening there. You might
even consider importing it and using it ...

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top