Hi gents ! I was working on an extjs client intended to discuss with web2py when I stumbled upon this weird behaviour:
with my client calling "PUT /defaut/api/alarms/1.json", I want the server to respond a 409 error code with good json return {success: false, errors: {...}} and use raise HTTP(409, {"success":False, "errors":{...}}) to generate this error. Unfortunately, even if the call has been done with a ".json", the content-type header of the response is set to "text/html" and thus, the code adds a <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //--> at the end for a 4xx code (not for a 5xx code, which works for me). Shouldn't the content-type be set to text/json or something similar ? Thanks for your support !