Re: [web2py] How to include headers in gluon.http.HTTP exceptions?

2013-03-08 Thread Ricardo Pedroso
On Thu, Mar 7, 2013 at 2:47 AM, Alec Taylor wrote: > My attempt: > > msg = (403, json.dumps({"state": "", "error_message": None, "error": > "unauthorized_client"}), None, {'Content-Type': 'application/json'}) > If I recall correctly, you are missing a ** Should be: msg = (403, json.dumps({"state

[web2py] How to include headers in gluon.http.HTTP exceptions?

2013-03-06 Thread Alec Taylor
My attempt: msg = (403, json.dumps({"state": "", "error_message": None, "error": "unauthorized_client"}), None, {'Content-Type': 'application/json'}) raise HTTP(*msg) What I get back: < HTTP/1.1 403 FORBIDDEN < Content-Length: 68 < Content-Type: text/html; charset=UTF-8 < Date: Thu, 07 Mar 2013