473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Accessing POST parameters from BaseHTTPServer

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
Nov 6 '08 #1
1 3802
James wrote:
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
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Nov 7 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Molly | last post by:
Peace, Pythonphiles! Python's std lib BaseHTTPServer: I'm stuck with a nasty spoiler -- I get erratic "Network error: disconnected by peer" for _POST_ requests only. =Background= I'm...
0
by: Joshua W. Biagio | last post by:
Hello all, I am having difficulty getting the HTTP/1.1 support (i.e. pipelining and persistent connections) for the BaseHTTPServer library to work. When I change the line for the protocol in...
1
by: Yin | last post by:
Hello. I am using the basehttpserver to implement the HTTP protocol to serve a fairly large lexicon that I have loaded as a dictionary in python. Rather than writing a whole server, I would like...
0
by: Jeff Gercken | last post by:
I want my http server to return a default form, regardless of the GET request, but I'm a bit of a noob and have no idea how. I'm trying to write a platform-independent captured portal for my...
0
by: Ron Garret | last post by:
I'm write a web server using BaseHTTPServer. It can't be a CGI because it has to do some weird server-push stuff as database updates come in. But I still need to process form inputs as if it were...
0
by: guddi1 | last post by:
Hi, I am looking to figure out how to display parameters of a post request. I am working in visual C++ environment. I have a program that tracks and outputs URL activity. For instance, when I log...
2
by: Vlad Dogaru | last post by:
Hello, After experimenting for a while, I am still not able to find where the POST data is in the BaseHTTPRequestHandler class. I am trying to write a very simple HTTP server for a project of...
3
by: Ron Garret | last post by:
I have a fairly large web app written in Python as a CGI fairly elaborate CGI. All of the requests go through a single CGI script which does authentication and session management and then...
0
by: samwyse | last post by:
I've just now submitted two issues to the issue tracker: 1491 BaseHTTPServer incorrectly implements response code 100 RFC 2616 sec 8.2.3 states, "An origin server that sends a 100...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.