Open ordnungswidrig opened 11 years ago
For now, I use ring.middleware.params/wrap-params
and ring.middleware.json-params/wrap-json-params
to do this kind of work. And they are very easy to use. So if we want to do this in liberator, Which content-type should be supported first?
We need to differentiate between query parameters and the body. The body can encode parameters as application/url-form-encoded but also transport any other media type.
I think the a body-parsing step should convert the body input stream into a body representation. Maybe a ring middle ware is the right thing to do which exposes the parsed data in the request at :parsed-body or like that.
The counterpart to representation generation is the parsing of the entity in the request body for POST, PUT, PATCH. We need a extensible mechanism like for the representation to enable parsing of the body input stream into a data structure.