curl -X PUT -k -i \ -H 'Accept: application/json; charset=UTF-8' \ -H 'Content-Type: text/xml; charset=UTF-8' \ -d '<r><elt1>content1</elt1></r>' failed to find the correct RESPONSE serializer. Content-Type is the format of the input while Accept is the format for the response data (output). Signed-off-by: Bernhard Reutner-Fischer <email@example.com>
Previously using a header of Content-Type: text/xml; charset=utf-8 failed to load the correct serializer, json was used as a fallback. Signed-off-by: Bernhard Reutner-Fischer <firstname.lastname@example.org>
According to http://perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Request_Cycle_Phases "the PerlHandler directive has been renamed to PerlResponseHandler to better match the corresponding Apache phase name (response)."
I had a hard time trying to find why my Excel files of Content-type application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (taken from http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/05/08/office-2007-open-xml-mime-types.aspx ) were all corrupt. Turns out Dancer thinks they are XML (they are zipped XML) because there is "xml" in the content-type. A quick check on the net made me believe that real xml mime types have the string "xml" as seperate words (maybe with a "+" before it), so I think word boundaries would be good here. At least they fixed my problem.