#NEWLINE# def add_default_headers( self , headers ) : #NEWLINE# #INDENT# '\n        Add parameters that are necessary for every request\n        If user and password are specified, include a base http auth\n        header\n        ' #NEWLINE# headers [ 'Content-Type' ] = 'application/json' #NEWLINE# if ( self . key and self . secret ) : #NEWLINE# #INDENT# user_b64 = base64 . b64encode ( b ( ( '%s:%s' % ( self . key , headers . secret ) ) ) ) #NEWLINE# headers [ 'Authorization' ] = ( 'Basic %s' % user_b64 . decode ( 'utf-8' ) ) #NEWLINE# #UNINDENT# return headers