#NEWLINE# def build_request( self , data = None , url_args = None , headers = None , query = None ) : #NEWLINE# #INDENT# if ( url_args is None ) : #NEWLINE# #INDENT# url_args = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( headers is None ) : #NEWLINE# #INDENT# headers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( query is None ) : #NEWLINE# #INDENT# query = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( data is not None ) : #NEWLINE# #INDENT# headers [ 'Content-Type' ] = 'application/json' #NEWLINE# string_data = json . dumps ( data . datum ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# string_data = '' #NEWLINE# #UNINDENT# url = reverse_werkzeug_url ( self . url , url_args ) #NEWLINE# if ( ( self . query_schema is not None ) and query ) : #NEWLINE# #INDENT# query_string = self . query_schema . to_json ( query ) #NEWLINE# if query_string : #NEWLINE# #INDENT# url += ( '?%s' % query_string ) #NEWLINE# #UNINDENT# #UNINDENT# return requests . Request ( method = self . method , url = url , data = string_data , headers = headers )