abc@@sSddlmZddlmZddlmZdgZdefdYZdS(i(tabsolute_importi(tencode_multipart_formdata(t urlencodetRequestMethodscB@szeZdZeddddgZd dZd d ed dZd d dZ d d dZ d d ed d Z RS( s Convenience mixin for classes who implement a :meth:`urlopen` method, such as :class:`~urllib3.connectionpool.HTTPConnectionPool` and :class:`~urllib3.poolmanager.PoolManager`. Provides behavior for making common types of HTTP request methods and decides which type of request field encoding to use. Specifically, :meth:`.request_encode_url` is for sending requests whose fields are encoded in the URL (such as GET, HEAD, DELETE). :meth:`.request_encode_body` is for sending requests whose fields are encoded in the *body* of the request using multipart or www-form-urlencoded (such as for POST, PUT, PATCH). :meth:`.request` is for making any kind of request, it will look up the appropriate encoding format and use one of the above two methods to make the request. Initializer parameters: :param headers: Headers to include with all requests, unless other headers are given explicitly. tDELETEtGETtHEADtOPTIONScC@s|p i|_dS(N(theaders(tselfR((s?/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/request.pyt__init__)scK@stddS(NsMClasses extending RequestMethods must implement their own ``urlopen`` method.(tNotImplemented(R tmethodturltbodyRtencode_multiparttmultipart_boundarytkw((s?/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/request.pyturlopen,scK@s]|j}||jkr:|j||d|d||S|j||d|d||SdS(s Make a request using :meth:`urlopen` with the appropriate encoding of ``fields`` based on the ``method`` used. This is a convenience method that requires the least amount of manual effort. It can be used in most situations, while still having the option to drop down to more specific methods when necessary, such as :meth:`request_encode_url`, :meth:`request_encode_body`, or even the lowest level :meth:`urlopen`. tfieldsRN(tuppert_encode_url_methodstrequest_encode_urltrequest_encode_body(R R R RRt urlopen_kw((s?/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/request.pytrequest2s cK@sb|dkr|j}ni|d6}|j||rO|dt|7}n|j|||S(s Make a request using :meth:`urlopen` with the ``fields`` encoded in the url. This is useful for request methods like GET, HEAD, DELETE, etc. Rt?N(tNoneRtupdateRR(R R R RRRtextra_kw((s?/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/request.pyRHs    c K@s|dkr|j}niid6}|rd|krFtdn|rgt|d|\} } nt|d} } | |ds