Hi,
I'd like to respond with a complex data structure when raising a HTTP 409 Conflict as response to a restful request but I can't seem to figure out how. If possible, I'd like to reuse as much as possible from built-in functions in web2py. The best idea I've gotten so far is something like this:
@auth.requires_login()
@request.restful()
def test():
response.view = 'generic.'+request.extension
def GET(*args,**vars):
page = response.render('generic.'+request.extension, dict(errors=["error1", "error2"]))
raise HTTP(409, page)
return locals()
However, this does not set the appropiate Content-Type. Are there easier/better ways to do what I want?