#NEWLINE# def _make_request( self , method , url , data = None , content_type = None , headers = None , target_object = None ) : #NEWLINE# #INDENT# "A low level method to send a request to the API.\n\n        Typically, you shouldn't need to use this method.\n\n        :type method: string\n        :param method: The HTTP method to use in the request.\n\n        :type url: string\n        :param url: The URL to send the request to.\n\n        :type data: string\n        :param data: The data to send as the body of the request.\n\n        :type content_type: string\n        :param content_type: The proper MIME type of the data provided.\n\n        :type headers: dict\n        :param headers: A dictionary of HTTP headers to send with the request.\n\n        :type target_object: object or :class:`NoneType`\n        :param target_object: Argument to be used by library callers.\n                              This can allow custom behavior, for example, to\n                              defer an HTTP request and complete initialization\n                              of the object at a later time.\n\n        :rtype: tuple of ``response`` (a dictionary of sorts)\n                and ``content`` (a string).\n        :returns: The HTTP response object and the content of the response,\n                  returned by :meth:`_do_request`.\n        " #NEWLINE# headers = ( headers or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# headers [ 'Accept-Encoding' ] = 'gzip' #NEWLINE# if data : #NEWLINE# #INDENT# content_length = len ( str ( data ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# content_length = 0 #NEWLINE# #UNINDENT# headers [ 'Content-Length' ] = str ( content_length ) #NEWLINE# if content_type : #NEWLINE# #INDENT# headers [ 'Content-Type' ] = url #NEWLINE# #UNINDENT# headers [ 'User-Agent' ] = self . USER_AGENT #NEWLINE# return self . _do_request ( method , url , headers , data , target_object )