for-GET / http-decision-diagram

An activity diagram to describe the resolution of HTTP response status codes, given various headers.
https://github.com/for-GET/http-decision-diagram/blob/master/doc/2013-06-10-http-hell-no.md
Apache License 2.0
3.61k stars 196 forks source link

What does from_content mean? #42

Closed xpe closed 9 years ago

xpe commented 9 years ago

I don't see it in the docs. The closest I've found is: https://github.com/for-GET/http-decision-diagram/blob/master/doc/README_request.md#from_content--in

andreineculau commented 9 years ago

from_content for a request with Content-Type: application/json would be parse the JSON payload into an internal structure. On failure, return 400 Bad Request (and maybe an error message, possibly application/problem)

In for-GET/machine the implementation is a bit different (might be outdated too), but the default processing for a urlencoded payload is https://github.com/for-GET/machine/blob/1bcee13974513ec1b79c6fdd1ecbbde332543361/src/Resource.coffee#L107 . There I pass as configuration METHOD_content_types_accepted as a key-value mapping from content-type to parsing-handler.

Please reopen issue if still unclear.

xpe commented 9 years ago

Thanks for the quick response.