Re: [racket] Building a server that responds to POST/PUT/DELETE requests

2011-09-13 Thread Daniel MacDougall
Works great. Thanks! Daniel On Tue, Sep 13, 2011 at 7:58 AM, Jay McCarthy wrote: > I just pushed a fix to these issues. > > Problem 1 was that I only read request bodies on POSTs. > > Problem 2 was that I misread the spec and didn't see that request > bodies had to have Content-Length fields. >

Re: [racket] Building a server that responds to POST/PUT/DELETE requests

2011-09-13 Thread Jay McCarthy
I just pushed a fix to these issues. Problem 1 was that I only read request bodies on POSTs. Problem 2 was that I misread the spec and didn't see that request bodies had to have Content-Length fields. Jay On Mon, Sep 12, 2011 at 12:29 PM, Daniel MacDougall wrote: > Thanks for the reply. See be

Re: [racket] Building a server that responds to POST/PUT/DELETE requests

2011-09-12 Thread Daniel MacDougall
Thanks for the reply. See below for the server code I'm using. I narrowed down the problem a bit and there are actually two different but related issues. The first is that request data is ignored for non-POST, non-PUT requests: $ curl http://localhost:8000 -d "abcd" -X POST *POST**abcd* $ curl h

Re: [racket] Building a server that responds to POST/PUT/DELETE requests

2011-09-12 Thread Jay McCarthy
This sounds strange to me. Request objects have a 'method' field that you can look at it. The bindings are a promise so that non-form-data POST content doesn't get erroneously parsed as bindings (unless you force the promise). This is all in place so that you can implement which ever methods you wa

[racket] Building a server that responds to POST/PUT/DELETE requests

2011-09-10 Thread Daniel MacDougall
Hi, I'm trying to build a web server that responds to [POST/PUT/DELETE] requests. If I use the built-in web server and POST to a url I have defined a dispatch function for, the request hangs indefinitely. The docs say that the web server tries to hide the details of the request method from you. Is