#NEWLINE# def add_auth( self , request ) : #NEWLINE# #INDENT# request . headers [ 'Content-Type' ] = 'application/json' #NEWLINE# params = { #NEWLINE# #INDENT# 'api_token' : self . api_token , #NEWLINE# #UNINDENT# } #NEWLINE# if ( request . method . upper ( ) in http . URLENCODE_METHODS ) : #NEWLINE# #INDENT# request . params . update ( params ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# request . params = json . dumps ( params . params ) #NEWLINE# request . uri += ( '?' + http . urlencode_any ( params ) )