Bizarre problem with HTTP POST verb and HTTPServer on Win32
rhamorim at my-deja.com
rhamorim at my-deja.com
Sat Oct 7 01:26:15 EDT 2000
I'm looking at this myself, as I've run on the same problem. If I have
any more news I'll tell you.
BTW... dit you have any success after the message below?
Regards,
Roberto "Wolfox" Amorim
In article <2bBu5.22221$r4.11782 at news.indigo.ie>,
"mail.indigo.ie" <regkey at yahoo.com> wrote:
> Hi,
>
> Something very weird is happening; I have written a simple subclass of
> HTTPRequestHandler which should handle HTTP GET and HTTP POST. It
works
> fine for HTTP GET but seems doesn't always respond to a POST on Win32.
>
> If I create a form with method=POST and submit it then IE fails with
> "connection reset by peer", curl (http://curl.haxx.nu) also fails. It
> looks like a problem with whatever the equivalent of SIGPIPE is on
Win32:
>
> administrator$ curl -i -d a=b localhost:6543
> administrator$ curl -v -i -d a=b localhost:6543
> * Connected to John Smart (127.0.0.1)
> > POST / HTTP/1.0
> User-Agent: curl/7.2 (win32) libcurl 7.2.1
> Host: localhost:80
> Pragma: no-cache
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> > Content-Length: 3
> > Content-Type: application/x-www-form-urlencoded
> > a=b
>
> The source is simply:
>
> import BaseHTTPServer
>
> class MyHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
>
> def do_POST(this):
> this.do_GET()
>
> def do_GET(this):
> this.send_response(200)
> this.send_header("Content-type", "text/html")
> this.end_headers()
> this.wfile.write("Hello!\n")
>
> svr = BaseHTTPServer.HTTPServer(('', 6543), MyHTTPRequestHandler)
>
> print "listing on port 6543"
>
> svr.serve_forever()
>
> Has anyone got any idea what is going on?
>
> Regards,
>
> Niall Smart
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list