Module Expr Str Import alias ImportFrom alias alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword IfExp Call NameLoad AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If BoolOpAnd CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareIs AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore NameLoad TryExcept body Assign NameStore Call NameLoad Call NameLoad NameLoad handlers ExceptHandler type NameLoad body TryExcept body Assign NameStore Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr attr handlers ExceptHandler type TupleLoad NameLoad NameLoad body If CompareGt AttributeLoad NameLoad attr Num body Print Str If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad keyword IfExp Call NameLoad AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr IfExp CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr CompareNotIn NameLoad NameLoad TryExcept body Assign NameStore Dict If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return NameLoad handlers ExceptHandler type NameLoad name NameStore body Raise Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareNotIn NameLoad NameLoad body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotIn AttributeLoad NameLoad attr TupleLoad Str Str body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Assign NameStore IfExp CompareEq AttributeLoad NameLoad attr Str Num Num Assign NameStore BoolOpAnd CompareEq AttributeLoad NameLoad attr Str IfExp NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr keyword Str keyword Str Assign NameStore IfExp NameLoad Dict Str Str NameLoad NameLoad Dict If CompareIs NameLoad NameLoad body Assign NameStore Dict If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If BoolOpAnd UnaryOpNot NameLoad CompareIsNot NameLoad NameLoad CompareNotIn Str NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If CompareIs Call NameLoad NameLoad NameLoad body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return Call NameLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Delete AttributeDel AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body With NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str FunctionDef arguments args defaults body Assign NameStore Call NameLoad For NameStore NameLoad body Assign SubscriptStore NameLoad Index Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Expr Call NameLoad
N/A N/A A simple HTTP client which mixes httplib with gevent and PayPal protecteds.

It provides convenience functions for the standard set of `HTTP methods`_:

>>> http_client.get('http://example.com/foo') # doctest: +SKIP

which are just shortcuts for the corresponding :py:func:`request` call:

>>> http_client.request("get", "http://example.com/foo") # doctest: +SKIP

.. _HTTP Methods: http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods

If you don't intend to read the response's body, you should use a
context manager:

>>> with http_client.get('http://www.example.com') as response: # doctest: +SKIP
...    assert response.status == 200

This will release the underlying socket back to the socket pool.
 N/A httplib urlparse urlparse urlunparse N/A functools N/A urllib2 N/A os N/A json N/A context N/A connection_mgr N/A async gevent socket gevent ssl _GHTTPConnection N/A N/A httplib HTTPConnection N/A N/A default_port N/A httplib HTTP_PORT __init__ N/A N/A self host port strict timeout protected N/A None None N/A socket _GLOBAL_DEFAULT_TIMEOUT None N/A N/A N/A N/A N/A httplib HTTPConnection __init__ self host port strict timeout N/A N/A self protected protected N/A connect N/A N/A self N/A N/A N/A ctx N/A N/A context get_context N/A N/A self sock N/A N/A N/A ctx connection_mgr get_connection N/A N/A self host N/A self port N/A self protected read_timeout N/A N/A isinstance N/A self timeout float N/A self timeout None N/A N/A self _tunnel_host N/A N/A N/A N/A self _tunnel N/A release_sock N/A N/A self N/A N/A N/A N/A N/A N/A self _HTTPConnection__state N/A httplib _CS_IDLE N/A N/A self _HTTPConnection__response None N/A self sock N/A N/A N/A N/A N/A N/A N/A context get_context connection_mgr release_connection N/A self sock N/A N/A self sock None N/A _set_content_length N/A N/A self body N/A N/A N/A thelen None N/A N/A N/A thelen N/A str N/A len body N/A N/A N/A TypeError N/A N/A N/A N/A thelen N/A str N/A N/A N/A os fstat N/A N/A body fileno st_size N/A N/A N/A N/A AttributeError OSError N/A N/A N/A N/A self debuglevel 0 N/A N/A Cannot stat file-type HTTP body. N/A N/A thelen None N/A N/A N/A N/A self putheader Content-Length thelen N/A __del__ N/A N/A self N/A N/A N/A N/A N/A self release_sock N/A N/A _GHTTPSConnection N/A _GHTTPConnection N/A N/A default_port N/A httplib HTTPS_PORT __init__ N/A N/A self host port strict timeout N/A None None N/A socket _GLOBAL_DEFAULT_TIMEOUT N/A N/A N/A N/A _GHTTPConnection __init__ self host port strict timeout protected N/A connection_mgr PLAIN_SSL N/A connect N/A N/A self N/A N/A N/A ctx N/A N/A context get_context N/A N/A self _tunnel_host N/A N/A N/A self sock N/A N/A N/A ctx connection_mgr get_connection N/A N/A self host N/A self port ssl None read_timeout N/A N/A isinstance N/A self timeout float N/A self timeout None N/A N/A N/A self _tunnel N/A N/A N/A self sock _msock N/A N/A N/A self protected N/A connection_mgr PLAIN_SSL N/A N/A ssl wrap_socket N/A N/A self sock _msock N/A N/A async wrap_socket_context N/A N/A self sock _msock N/A self protected N/A N/A N/A N/A _GHTTPConnection connect self N/A N/A urllib2_request N/A N/A u2req timeout N/A None N/A N/A     Translate a urllib2.Request to something we can pass to our
    request() function, and translate our Response to a
    urllib2.addinfourl object
     N/A method N/A N/A u2req get_method N/A url N/A u2req _Request__original N/A body N/A N/A u2req get_data N/A headers N/A dict N/A u2req unredirected_hdrs N/A N/A N/A headers update N/A N/A k v N/A N/A k v N/A N/A N/A u2req headers items N/A k headers N/A N/A N/A kwargs N/A N/A N/A timeout None N/A N/A N/A kwargs N/A timeout timeout N/A resp N/A request method url body headers kwargs N/A hr N/A resp http_response N/A N/A hr recv N/A hr read N/A fp N/A N/A socket _fileobject hr close True N/A aiu N/A N/A urllib2 addinfourl fp fp headers N/A hr msg url N/A N/A resp request url N/A N/A aiu code N/A hr status N/A N/A aiu msg N/A hr reason N/A aiu N/A N/A N/A ValueError N/A e N/A N/A N/A N/A urllib2 URLError N/A e msg N/A request N/A N/A method url body headers literal use_protected timeout N/A None None False False N/A socket _GLOBAL_DEFAULT_TIMEOUT N/A N/A     A function to issue HTTP requests.

    :param method: the `HTTP method`_ for this request. Case
      insensitive.

    :param url: the URL to request. Must include a protocol
      (e.g. `http`, `https`).

    :param body: the body of the request, if applicable

    :type body: a string or file-like object (i.e, an object that has
      a ``read`` method).  It could also be a dict, in which case
      it is stringified, and the header set to application/json

    :param headers: A dictionary of request headers

    :type headers: :py:class:`dict`

    :param literal: if true, instruct
      :py:class:`~httplib.HTTPConnection` **not** to set the ``Host`` or
      ``Accept-Encoding`` headers automatically.  Useful for testing

    :param use_protected: if true, use the appropriate protected for
      this call.

    :param timeout: connection timeout for this request.

    :returns: a :py:class:`Response` object.

    An example, calling up google with a custom host header:

    >>> request('get',
    ...         'http://google.com',
    ...         headers={'Host': 'www.google.com'},
    ...         literal=True)
    <http_client.Response (200) GET http://google.com>

    .. _HTTP Method: http://en.wikipedia.org/wiki/    Hypertext_Transfer_Protocol#Request_methods

     N/A method N/A N/A method upper N/A N/A method _HTTP_METHODS N/A N/A N/A ValueError N/A N/A invalid http method {0} format method N/A parsed N/A urlparse url N/A N/A N/A parsed scheme N/A http https N/A N/A N/A ValueError N/A unknown protocol %s N/A parsed scheme N/A N/A domain _ port N/A N/A N/A parsed netloc partition : N/A N/A N/A port N/A int port N/A N/A N/A ValueError N/A N/A port N/A N/A N/A parsed scheme http 80 443 N/A protected N/A N/A N/A parsed scheme https N/A use_protected True PLAIN_SSL N/A conn N/A _GHTTPConnection domain port protected protected timeout timeout N/A selector N/A urlunparse N/A N/A parsed _replace scheme netloc N/A skips N/A literal N/A skip_host skip_accept_encoding True True N/A N/A N/A headers None N/A N/A headers N/A N/A N/A literal N/A N/A N/A N/A headers setdefault User-Agent python N/A N/A isinstance body dict N/A N/A body N/A N/A json dumps body N/A N/A Content-Type headers N/A N/A N/A headers N/A Content-Type application/json N/A N/A N/A conn putrequest method selector skips N/A N/A N/A literal N/A body None N/A Content-Length headers N/A N/A N/A N/A conn _set_content_length body N/A N/A header value N/A N/A headers items N/A N/A N/A N/A type value list N/A N/A subvalue value N/A N/A N/A N/A conn putheader header subvalue N/A N/A N/A N/A conn putheader header value N/A N/A N/A conn endheaders N/A N/A body None N/A N/A N/A N/A conn send body N/A raw N/A N/A conn getresponse N/A N/A raw _connection conn N/A N/A Response N/A Request method url headers body N/A raw status N/A raw msg raw N/A Request N/A object N/A N/A     A simple wrapper for HTTP Requests

    .. py:attribute:: method

       The method used for this request (e.g., `POST`, `GET`).

    .. py:attribute:: url

       The requested URL.

    .. py:attribute:: headers

       The request headers (a :py:class:`list` of two-item :py:class:`tuples`)

    .. py:attribute:: body

       The body if present, otherwise `None`.
     __init__ N/A N/A self method url headers body N/A N/A N/A N/A self method method N/A N/A self url url N/A N/A self headers headers N/A N/A self body body N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A <http_client.Request {0} {1}> format N/A self method N/A self url N/A N/A Response N/A object N/A N/A \
    A simple wrapper for HTTP responses.

    .. py:attribute:: request

      the :py:class:`Request` object that lead to this response

    .. py:attribute:: status

      the numeric status code for this Response

    .. py:attribute:: headers

      an :py:class:`~httplib.HTTPMessage` object containing this
      response's headers.  You can treat this as a dictionary: for
      example, you can get the value for the ``Host`` header with
      ``msg['Host']``.  **You should, however, be careful with
      duplicate headers.**

      Consider the following headers:

      >>> headers = '\r\n'.join(['X-First-Header: First, Value',
      ...                       'X-First-Header: Second, Value',
      ...                       'X-Second-Header: Final, Value',
      ...                       ''])

      Note that the header ``X-First-Header`` appears twice.

      >>> from StringIO import StringIO
      >>> from httplib import HTTPMessage
      >>> msg = HTTPMessage(StringIO(headers))
      >>> msg['X-First-Header']
      'First, Value, Second, Value'

      :py:class:`HTTPMessage` has *concatenated* the two values we
      provided for `X-First-Header` (`First, Value` and `Second,
      Value`) with a comma.  Unfortunately both of these values
      contain a comma.  That means a simple :py:meth:`str.split` can't
      Recover the original values:

      >>> msg['X-First-Header'].split(', ')
      ['First', 'Value', 'Second', 'Value']

      The same behavior occurs with :meth:`HTTPMessage.items`:

      >>> msg.items() # doctest: +NORMALIZE_WHITESPACE
      [('x-second-header', 'Final, Value'),
       ('x-first-header', 'First, Value, Second, Value')]

      To correctly recover values from duplicated header fields, use
      :meth:`HTTPMessage.getheaders`:

      >>> msg.getheaders('X-First-Header')
      ['First, Value', 'Second, Value']

    .. py:attribute:: http_response

       the underlying :py:class:`~httplib.HTTPResponse` object for
       this response.
     __init__ N/A N/A self request status headers http_response N/A N/A N/A N/A self request request N/A N/A self status status N/A N/A self headers headers N/A N/A self http_response http_response N/A N/A self _body None N/A close N/A N/A self N/A N/A N/A Release the underlying socket back to the connection pool.  This
        will be automatically called by :meth:`~Response.body`
        after the body has been read.  You should arrange to have this called (

         N/A N/A hasattr N/A self http_response _connection N/A N/A N/A N/A N/A N/A self http_response _connection release_sock N/A N/A N/A self http_response _connection N/A N/A N/A N/A self http_response close N/A __enter__ N/A N/A self N/A N/A N/A self N/A __exit__ N/A N/A self N/A exc_info N/A N/A N/A N/A self close N/A body N/A N/A self N/A N/A N/A the body of the request, if applicable.

        Since this value is lazily loaded, if you never access it the
        response's body will never be downloaded.  Once loaded it's
        stored locally, so repeated accesses won't trigger repeated
        network calls.
         N/A N/A N/A self _body None N/A N/A self N/A N/A N/A self _body N/A N/A N/A self http_response read N/A N/A self _body N/A property __repr__ N/A N/A self N/A N/A N/A N/A N/A <http_client.Response ({0}) {1} {2}> format N/A self status N/A N/A self request method N/A N/A self request url N/A N/A N/A _HTTP_METHODS N/A GET HEAD POST PUT DELETE TRACE OPTIONS CONNECT PATCH _init_methods N/A N/A N/A N/A N/A g N/A globals N/A m _HTTP_METHODS N/A N/A N/A g N/A N/A N/A m lower N/A N/A functools partial request m N/A N/A N/A _init_methods