@staticmethod<EOL><INDENT>def validate_request():<DEDENT>
flask_request = request<EOL>request_data = flask_request.get_data()<EOL>if not request_data:<EOL><INDENT>request_data = b'<STR_LIT:{}>'<EOL><DEDENT>request_data = request_data.decode('<STR_LIT:utf-8>')<EOL>try:<EOL><INDENT>json.loads(request_data)<EOL><DEDENT>except ValueError as json_error:<EOL><INDENT>LOG.debug("<STR_LIT>", str(json_error))<EOL>return LambdaErrorResponses.invalid_request_content(<EOL>"<STR_LIT>")<EOL><DEDENT>if flask_request.args:<EOL><INDENT>LOG.debug("<STR_LIT>")<EOL>return LambdaErrorResponses.invalid_request_content("<STR_LIT>")<EOL><DEDENT>request_headers = CaseInsensitiveDict(flask_request.headers)<EOL>log_type = request_headers.get('<STR_LIT>', '<STR_LIT:None>')<EOL>if log_type != '<STR_LIT:None>':<EOL><INDENT>LOG.debug("<STR_LIT>", log_type)<EOL>return LambdaErrorResponses.not_implemented_locally(<EOL>"<STR_LIT>".format(log_type))<EOL><DEDENT>invocation_type = request_headers.get('<STR_LIT>', '<STR_LIT>')<EOL>if invocation_type != '<STR_LIT>':<EOL><INDENT>LOG.warning("<STR_LIT>", invocation_type)<EOL>return LambdaErrorResponses.not_implemented_locally(<EOL>"<STR_LIT>".format(invocation_type))<EOL><DEDENT>
Validates the incoming request

The following are invalid
    1. The Request data is not json serializable
    2. Query Parameters are sent to the endpoint
    3. The Request Content-Type is not application/json
    4. 'X-Amz-Log-Type' header is not 'None'
    5. 'X-Amz-Invocation-Type' header is not 'RequestResponse'

Returns
-------
flask.Response
    If the request is not valid a flask Response is returned

None:
    If the request passes all validation