[racket] simple http server without stateful/stateless continuations stuff

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Jul 5 09:28:02 EDT 2014

Yes.

If you use "serve/servlet" and never call any "send/*" function except
"send/back", then you won't get any continuation handling. You can
also pass web-server/managers/none as #:manager and any attempt to use
continuations will error. If you want to write your own
headers/content yourself, then you could use a raw "response"
structure.

Another thing you can do is use serve/launch/wait and just give a
dispatcher that uses web-server/dispatchers/dispatch-lift or even just
grabs connection-o-port itself and writes raw.

That documentation, btw, is not private internals. It's designed for
people to write their own custom Web servers.

Jay

On Fri, Jul 4, 2014 at 7:25 PM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> In Racket 5.3.4, is there a way to use the barebones HTTP-serving
> functionality of the Racket Web Server code, without getting any of the
> ``Stateful'' or ``Stateless'' stuff, nor any trickiness that it does with
> the callback code to support the continuations?
>
> I just want each request to result in a callback in a new thread that lets
> me get header values and read POST data, and then write the response headers
> and content to a port.)
>
> I see the documentation in
> "http://docs.racket-lang.org/web-server-internal/dispatch-server-unit.html",
> which looks like it might have things I can use (unclear), but it appears to
> be some documentation on private internals, not public API.
>
> (This is for some unit testing of clients for various webservices, in which
> I need to emulate the interfaces of the webservices, and to have the tests
> be able to see both client and server sides.  For this purpose, I really
> don't want the "web-server" trickiness with the code, and I need a public
> API.)
>
> Neil V.
>
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



-- 
Jay McCarthy
http://jeapostrophe.github.io

           "Wherefore, be not weary in well-doing,
      for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
                          - D&C 64:33

Posted on the users mailing list.