[Tutor] Handling post request

Tiago Katcipis katcipis at inf.ufsc.br
Wed Jan 28 12:20:00 CET 2009


actualy i have found what i wanted on the rfile attribute, i already tried
before to read it but the application just freezes when i try to read() or
readline() on it. But after i make the request, and both client and server
sides freezes, if i kill the client side the server becomes able of reading
the rfile.

Does anyone know why i just cant read the rfile without killing the client
side? it feels like the client side is waiting for something while the
server is unable to read the rfile while the client side is waiting.

On Wed, Jan 28, 2009 at 9:09 AM, Tiago Katcipis <katcipis at inf.ufsc.br>wrote:

> thanks for the help, im really not used on doing web stuff, ill try reading
> the how to.
>
>
> On Wed, Jan 28, 2009 at 9:03 AM, Alan Gauld <alan.gauld at btinternet.com>wrote:
>
>> "Tiago Katcipis" <katcipis at inf.ufsc.br> wrote
>>
>>  I am trying to make a small HTTP server on python just to handle some
>>> POST
>>> and GET requests. I never worked with http before and dont know if i am
>>> doing something completely stupid (probably yes).
>>>
>>
>> Not stupid so much as overly complicated.
>>
>> The cgi module will do all the hard work for you including transparently
>> handling POST and GET requests
>>
>> Read the web HOWTO document:
>>
>> http://docs.python.org/howto/webservers.html
>>
>> Then read the CGI module documentation which includes a very quick
>> introduction to CGI programming. If you are intending expanding the web
>> site to anything beyond trivial consider using a Framework such as
>> Django, Turbo Gears or Pylons.
>>
>> Unless you are trying to do something very clever - which given your
>> level of knowledge I'd guess is not the case - then the standard
>> cgi module should do all you need!
>>
>> HTH,
>>
>>
>> --
>> Alan Gauld
>> Author of the Learn to Program web site
>> http://www.alan-g.me.uk/
>>
>>
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
>
>
> --
> "it might be a profitable thing to learn Java, but it has no intellectual
> value whatsoever" Alexander Stepanov
>



-- 
"it might be a profitable thing to learn Java, but it has no intellectual
value whatsoever" Alexander Stepanov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090128/e8c89884/attachment.htm>


More information about the Tutor mailing list