I'm having trouble getting any sort of response from Snap when I POST data. Everything works in the handler, but the application never writes any data to the socket. This can be seen by creating a new empty project with snap init, and running the resulting program. A terminal session follows:
tsuraan@macbeth ~/tmp/foo $ ls foo.cabal log resources src tsuraan@macbeth ~/tmp/foo $ snap --version Snap 0.4.1 Project Kickstarter [snip] tsuraan@macbeth ~/tmp/foo $ cabal install Resolving dependencies... Configuring foo-0.1... Preprocessing executables for foo-0.1... Building foo-0.1... [snip] Installing executable(s) in /home/tsuraan/.cabal/bin tsuraan@macbeth ~/tmp/foo $ foo & [1] 17442 tsuraan@macbeth ~/tmp/foo $ Initializing Heist/Impl... done. Initializing Timer/Timer... done. Listening on http://0.0.0.0:8000/ tsuraan@macbeth ~/tmp/foo $ curl -v http://localhost:8000/echo/hi * About to connect() to localhost port 8000 (#0) * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8000 (#0) > GET /echo/hi HTTP/1.1 > User-Agent: curl/7.20.0 (x86_64-pc-linux-gnu) libcurl/7.20.0 OpenSSL/0.9.8n > zlib/1.2.3 > Host: localhost:8000 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: text/html;charset=utf-8 < Date: Tue, 15 Mar 2011 21:30:04 GMT < Server: Snap/0.4.1 < Transfer-Encoding: chunked [HTML output] tsuraan@macbeth ~/tmp/foo $ curl -v -XPOST http://localhost:8000/echo/hi * About to connect() to localhost port 8000 (#0) * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8000 (#0) > POST /echo/hi HTTP/1.1 > User-Agent: curl/7.20.0 (x86_64-pc-linux-gnu) libcurl/7.20.0 OpenSSL/0.9.8n > zlib/1.2.3 > Host: localhost:8000 > Accept: */* > And then, it just hangs. My program also does this, which isn't working out very well for me right now. Is there something special that needs to be done to get a snap handler to reply to a POST, or is this a bug? _______________________________________________ Snap mailing list [email protected] http://mailman-mail5.webfaction.com/listinfo/snap
