The monasca_events_api.app.core.validation Module¶
- 
monasca_events_api.app.core.validation.validate_content_type(req, allowed)[source]¶ Validates content type.
Method validates request against correct content type.
If content-type cannot be established (i.e. header is missing),
falcon.HTTPMissingHeaderis thrown. If content-type is not application/json or text/plain,falcon.HTTPUnsupportedMediaTypeis thrown.- Parameters
 req (falcon.Request) – current request
allowed (iterable) – allowed content type
- Exception
 falcon.HTTPMissingHeader- Exception
 falcon.HTTPUnsupportedMediaType