Re: CGI POST problem was: How to read POSTed data

2005-02-07 Thread Dan Perl
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Sweet! > Glad you fixed it, and documented it all! > Thanks for the followups. > Now the next poor soul to stumble in can get the right fix. > Never know when it could be me ;) Thanks for the comments. I did indeed post

Re: CGI POST problem was: How to read POSTed data

2005-02-06 Thread M.E.Farmer
Sweet! Glad you fixed it, and documented it all! Thanks for the followups. Now the next poor soul to stumble in can get the right fix. Never know when it could be me ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI POST problem was: How to read POSTed data

2005-02-06 Thread Dan Perl
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > CGIHTTPServer, on the other hand, I have never really trusted. I would > suspect that fella. CGIHTTPServer wasn't the culprit after all, it was os.py. See bug report "[ 1100235 ] Scripts started with CGIHTTPServer: missing cgi envir

Re: How to read POSTed data

2005-02-06 Thread Dan Perl
"Dan Perl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks, Pierre, this got me much further but I hit another stumbling > block. I can see now that CGIHTTPServer writes all the header lines into > os.environ and creates a subprocess for the script with os.popen2 or > os.p

Re: How to read POSTed data

2005-02-06 Thread Dan Perl
"Pierre Quentel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >> Pierre, I am repeating some questions I already stated in another thread, >> 'CGI POST problem', but do you have any opinions on how CGIHTTPServer's >> do_POST handles requests? It looks to me like it always expe

Re: How to read POSTed data

2005-02-06 Thread Pierre Quentel
Pierre, I am repeating some questions I already stated in another thread, 'CGI POST problem', but do you have any opinions on how CGIHTTPServer's do_POST handles requests? It looks to me like it always expects form data to be part of the POST command header, in the path of the URL, just like a

Re: How to read POSTed data

2005-02-06 Thread Dan Perl
"Pierre Quentel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Here is an example of how to get the POST data : > > #def do_POST(self): > #ctype, pdict = > cgi.parse_header(self.headers.getheader('content-type')) > #length = int(self.headers.getheader('content

Re: CGI POST problem was: How to read POSTed data

2005-02-06 Thread Dan Perl
e Quentel's suggestion for an implementation of do_POST in the "How to read POSTed data" seems to handle requests of this kind, although I didn't personally try it. But the run_cgi method in CGIHTTPServer expects the form data to be only in the POST header line, in the path

Re: How to read POSTed data

2005-02-06 Thread Pierre Quentel
Here is an example of how to get the POST data : #def do_POST(self): #ctype, pdict = cgi.parse_header(self.headers.getheader('content-type')) #length = int(self.headers.getheader('content-length')) #if ctype == 'multipart/form-data': #self.body = cgi.parse_m

Re: CGI POST problem was: How to read POSTed data

2005-02-05 Thread Dan Perl
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan Perl wrote: > >> how is a multipart POST request parsed by CGIHTTPServer? > > It isn't; the input stream containing the multipart/form-data content > is passed to the CGI script, which can choose to parse it or not using > any code

Re: CGI POST problem was: How to read POSTed data

2005-02-05 Thread Dan Perl
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan, > I was wondering how you were coming with your project. > I had wondered if i had missed something going the CherryPy route > instead of CGI. Now I see that you have had a bit of a snag , sorry to > hear that. > I a

Re: CGI POST problem was: How to read POSTed data

2005-02-05 Thread M.E.Farmer
Dan Perl wrote: > I am piggybacking on Hakan's original posting because I am addressing the > same group of people (those with good knowledge in the standard web > programming modules), on a related topic. However, my question is > independent of Hakan's. > > I have trouble getting a simple CGI sc

Re: CGI POST problem was: How to read POSTed data

2005-02-05 Thread and-google
Dan Perl wrote: > how is a multipart POST request parsed by CGIHTTPServer? It isn't; the input stream containing the multipart/form-data content is passed to the CGI script, which can choose to parse it or not using any code it has to hand - which could be the 'cgi' module, but not necessarily.

CGI POST problem was: How to read POSTed data

2005-02-05 Thread Dan Perl
I am piggybacking on Hakan's original posting because I am addressing the same group of people (those with good knowledge in the standard web programming modules), on a related topic. However, my question is independent of Hakan's. I have trouble getting a simple CGI script to work because it

Re: How to read POSTed data

2005-02-05 Thread Dan Perl
"Håkan Persson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi. > > I am trying to set up a simple HTTP-server but I have problems reading > data that is beeing POSTed. > > class httpServer(BaseHTTPServer.BaseHTTPRequestHandler): >def do_POST(self): >input = self.rf

How to read POSTed data

2005-02-05 Thread Håkan Persson
Hi. I am trying to set up a simple HTTP-server but I have problems reading data that is beeing POSTed. class httpServer(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(self): input = self.rfile.read() The self.rfile.read() will hang on the data = self._sock.recv(recv_size) line in t