Hi all,

I have a pyramid application and want to return problem+json (as defined in 
https://tools.ietf.org/html/rfc7807 )

How can I handle this? My code looks like this.

from pyramid.httpexceptions import HTTPNotFound

def error_handler(self, message):
        response = HTTPNotFound()        
        response.body = dumps({'message': message})
        response.content_type = 'application/json'
        raise response


Change the content_type to application/problem+json does not work.

Regards,
Sascha

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/0a67abf6-c2ca-4e11-8c77-13401e42337a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to