Like #3 states, content_types_provided:handler is only called for GET/HEAD/PUT but not for POST.
Similarly, as https://github.com/basho/webmachine/issues/122 states, content_types_accepted:handler is only called for POST when post_is_create is true, and for PUT when is_conflict is false, but not for regular POST
Proposed resolutioncontent_types_accepted:handler should be called uniformly, regardless of the invoked HTTP method, right about where known_content_type is called. If it's known, then handle it (ie. translate it to Context)
content_types_provided:handler should be called uniformly, regardless of the flow (method, status code) IF there is a Content-Type response header set, and has_resp_body is false, right after webmachine_decision_core:respond handles the logic for HTTP status codes & headers.
Like #3 states,
content_types_provided
:handler is only called for GET/HEAD/PUT but not for POST.Similarly, as https://github.com/basho/webmachine/issues/122 states,
content_types_accepted
:handler is only called forPOST
whenpost_is_create
is true, and forPUT
whenis_conflict
is false, but not for regularPOST
Proposed resolution
content_types_accepted
:handler should be called uniformly, regardless of the invoked HTTP method, right about whereknown_content_type
is called. If it's known, then handle it (ie. translate it to Context)content_types_provided
:handler should be called uniformly, regardless of the flow (method, status code) IF there is aContent-Type
response header set, andhas_resp_body
is false, right afterwebmachine_decision_core:respond
handles the logic for HTTP status codes & headers.