[plt-dev] Re: web-server support for arbitrary content in POST requests?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Tue Feb 23 17:30:21 EST 2010

This is now lazy in SVN. No code should need to change, because the
same interface is provided, but lazily.

Danny, your application won't error until you actually try to look at
the bindings.

Jay

On Sun, Feb 21, 2010 at 7:58 PM, Danny Yoo <dyoo at cs.wpi.edu> wrote:
> For one of my web-server applications, I've been trying to reduce the
> amount of data traffic by applying a gzip on the data attached to my
> POST requests.  However, web-server doesn't like it for the data to be
> an arbitrary bytes: it expects it to be an encoding of an association
> list, and throws exceptions if it isn't.  But this defeats the whole
> purpose of request-post-data/raw.
>
> Can the following be wrapped within the call to parse-bindings (in
> web-server/http/request), to accommodate non-standard data values?
>
> (define (parse-bindings raw)
>  (with-handlers ([exn:fail? (lambda (exn) (list))])
>     ;; ... rest of the implementation
>     ))
>
> I don't know if this is exactly the right solution.  I'd prefer to be
> able to configure the web-server http request handler so that incoming
> requests aren't parsed unless the user really wants the bindings of a
> request.  I haven't thought deeply about how this might affect the
> structure of the web-server code, but I suspect it might just be a
> call to make parse-bindings be lazily computed.
>



-- 
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 dev mailing list.