8 lines
237 B
Python
8 lines
237 B
Python
|
import falcon
|
||
|
|
||
|
class RequireJson(object):
|
||
|
def process_request(self, req, resp):
|
||
|
if not req.client_accepts_json:
|
||
|
raise falcon.HTTPNotAcceptable(
|
||
|
'This API only supports responses encoded as JSON.')
|