Anonymous avatar Anonymous committed 8698e20

wrq fix

Comments (0)

Files changed (1)

WebmachineResources.wiki

 | create_path | undefined | Path | This will be called on a POST request if post_is_create returns true. The Path returned should be a valid URI part following the dispatcher prefix. That Path will replace the previous one in the return value of {{{ wrq:disp_path(ReqData) }}} for all subsequent resource function calls in the course of this request. |
 | process_post | false | _ | If post_is_create returns false, then this will be called to process any POST requests. If it succeeds, it should return true. |
 | content_types_provided | {{{ [{"text/html", to_html}] }}} | {{{ [{Mediatype, Handler}] }}} | This should return a list of pairs where each pair is of the form {{{ {Mediatype, Handler} }}} where {{{Mediatype}}} is a string of content-type format and the {{{Handler}}} is an atom naming the function which can provide a resource representation in that media type.  Content negotiation is driven by this return value. For example, if a client request includes an Accept header with a value that does not appear as a first element in any of the return tuples, then a 406 Not Acceptable will be sent. |
-| content_types_accepted | {{{ [] }}} | {{{ [{Mediatype, Handler}] }}} | This is used similarly to content_types_provided, except that it is for incoming resource representations -- for example, PUT requests. Instances of this function usually want to use {{{ webmachine_reqdata:req_body(ReqData) }}} to access the incoming request body.|
+| content_types_accepted | {{{ [] }}} | {{{ [{Mediatype, Handler}] }}} | This is used similarly to content_types_provided, except that it is for incoming resource representations -- for example, PUT requests. Instances of this function usually want to use {{{ wrq:req_body(ReqData) }}} to access the incoming request body.|
 | charsets_provided | no_charset | {{{ [{Charset, CharsetConverter}] }}} | If this is anything other than the atom no_charset, it must be a list of pairs where each pair is of the form Charset, Converter where Charset is a string naming a charset and Converter is a callable function in the resource which will be called on the produced body in a GET and ensure that it is in Charset. |
 | encodings_provided | {{{ [{"identity", fun(X) -> X end}] }}} | {{{ [{Encoding, Encoder}] }}} | This must be a list of pairs where in each pair Encoding is a string naming a valid content encoding and Encoder is a callable function in the resource which will be called on the produced body in a GET and ensure that it is so encoded.  One useful setting is to have the function check on method, and on GET requests return {{{ [{"identity", fun(X) -> X end}, {"gzip", fun(X) -> zlib:gzip(X) end}] }}} as this is all that is needed to support gzip content encoding. |
 | variances | {{{ [] }}} | {{{ [HeaderName] }}} | If this function is implemented, it should return a list of strings with header names that should be included in a given response's Vary header. The standard conneg headers (Accept, Accept-Encoding, Accept-Charset, Accept-Language) do not need to be specified here as Webmachine will add the correct elements of those automatically depending on resource behavior. | 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.