#NEWLINE# def request( self , method , path , params = None , data = None , headers = None , stream = False , **kwargs ) : #NEWLINE# #INDENT# if ( headers is None ) : #NEWLINE# #INDENT# headers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# headers . setdefault ( 'Accept' , 'application/json' ) #NEWLINE# if path : #NEWLINE# #INDENT# if ( not isinstance ( path , ( list , tuple ) ) ) : #NEWLINE# #INDENT# path = [ path ] #NEWLINE# #UNINDENT# url = utils . urljoin ( self . base_url , * path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# url = self . base_url #NEWLINE# #UNINDENT# response = self . session . request ( method , url , stream = stream , data = data , params = params , headers = headers , ** kwargs ) #NEWLINE# if stream : #NEWLINE# #INDENT# result = None #NEWLINE# self . _check_result ( response , result ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = utils . as_json ( response ) #NEWLINE# #UNINDENT# if ( result is None ) : #NEWLINE# #INDENT# return ( response , result ) #NEWLINE# #UNINDENT# if isinstance ( result , list ) : #NEWLINE# #INDENT# for res in result : #NEWLINE# #INDENT# self . _check_result ( response , res ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . _check_result ( response , result ) #NEWLINE# #UNINDENT# return ( response , result )