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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to