not tested: inspecting request.extension ?

On Monday, February 25, 2013 4:29:29 PM UTC+1, Alec Taylor wrote:
>
> One solution I can hack together is: 
>
> @service.json 
> def index(): 
>     raise HTTP(404, json.dumps({"Hello":'bar', "Foo": 'tar'})) 
>
> However when I access it without '.json' I would still get the error 
> response in JSON. 
>
> How can I make it so that JSON errors are only shown for '.json'; and 
> normal text messages are shown for HTML? 
>
> Thanks for all suggestions, 
>
> Alec Taylor 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to