#NEWLINE# def requests_request( self , method , abs_url , headers , params ) : #NEWLINE# #INDENT# method = method . lower ( ) #NEWLINE# if ( ( method == 'get' ) or ( method == 'delete' ) ) : #NEWLINE# #INDENT# if params : #NEWLINE# #INDENT# abs_url = self . build_url ( abs_url , params ) #NEWLINE# #UNINDENT# data = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( method == 'post' ) or ( method == 'put' ) ) : #NEWLINE# #INDENT# data = self . encode ( params ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Error ( ( 'Bug discovered: invalid request method: %s. Please report to contact@easypost.com.' % method ) ) #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# result = requests . request ( method , abs_url , headers = headers , data = data , timeout = 60 , verify = True ) #NEWLINE# http_body = result . text #NEWLINE# http_status = result . status_code #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# raise Error ( 'Unexpected error communicating with EasyPost. If this problem persists please let us know at contact@easypost.com.' ) #NEWLINE# #UNINDENT# return ( http_body , http_status )