#NEWLINE# def parse_request( self , request , **url_args ) : #NEWLINE# #INDENT# req = { #NEWLINE# #INDENT# 'url_args' : url_args , #NEWLINE# 'headers' : request . headers , #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# req [ 'json' ] = get_payload_from_http_message ( request ) #NEWLINE# #UNINDENT# except SpecError as e : #NEWLINE# #INDENT# raise HTTPError ( code = 400 , message = e . args [ 0 ] ) #NEWLINE# #UNINDENT# is_empty = ( request . data == '' ) #NEWLINE# if ( ( ( self . request_must_be_empty == True ) and ( not is_empty ) ) or ( is_empty and ( self . request_can_be_empty == False ) ) ) : #NEWLINE# #INDENT# raise HTTPError ( code = 400 , message = 'Invalid data' ) #NEWLINE# #UNINDENT# if ( self . query_schema is not None ) : #NEWLINE# #INDENT# req [ 'query' ] = self . query_schema . from_multi_dict ( request . args ) #NEWLINE# #UNINDENT# return req