[plt-scheme] bytes->request or equivalent?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon May 3 22:53:02 EDT 2010

There is not.

I often make them by hand in my test cases. But if you look in

http://github.com/plt/racket/blob/master/collects/tests/web-server/util.rkt

You'll see "make-mock-connection" which is most of what you want. That
and what's here:

http://github.com/plt/racket/blob/master/collects/tests/web-server/private/request-test.rkt

You'll see that I don't actually have many test cases.

Jay

On Mon, May 3, 2010 at 7:57 PM, Todd O'Bryan <toddobryan at gmail.com> wrote:
> Is there a bytes->request function hiding somewhere that could be used
> for testing? The only thing I can find to create a request requires a
> connection. I'd like to do something like:
>
> (define req
>  (bytes->request #"GET /path/to/something HTTP/1.1\r\nHost:
> www.foo.com\r\nCookie: abc=123; xyz=hello\r\n"))
>
> and have it produce a request structure. (I'd be willing to pass in
> more stuff if I had to.)
>
> Todd
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.