Back to index

moin  1.9.0~rc2
Public Member Functions Class Reference

List of all members.

Public Member Functions

def json

Detailed Description

Add json method to a request object.  This will parse the input data
through simplejson if possible.

:exc:`~werkzeug.exceptions.BadRequest` will be raised if the content-type
is not json or if the data itself cannot be parsed as json.

Definition at line 32 of file

Member Function Documentation

Get the result of simplejson.loads if possible.

Definition at line 41 of file

00042     def json(self):
00043         """Get the result of simplejson.loads if possible."""
00044         if 'json' not in self.environ.get('CONTENT_TYPE', ''):
00045             raise BadRequest('Not a JSON request')
00046         try:
00047             return loads(
00048         except Exception:
00049             raise BadRequest('Unable to read JSON request')

Here is the call graph for this function:

The documentation for this class was generated from the following file: