[plt-dev] web-server support for arbitrary content in POST requests?
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.