ó ®ŽTc@skyddlmZWn!ek r7ddlmZnXddlmZdgZdefd„ƒYZdS(iÿÿÿÿ(t urlencodei(tencode_multipart_formdatatRequestMethodscBsweZdZeddddgƒZd d„Zd d ed d„Zd d d„Z d d„Z 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. tDELETEtGETtHEADtOPTIONScCs|p i|_dS(N(theaders(tselfR((s3/usr/lib/python2.7/site-packages/urllib3/request.pyt__init__+scKstdƒ‚dS(NsMClasses extending RequestMethods must implement their own ``urlopen`` method.(tNotImplemented(RtmethodturltbodyRtencode_multiparttmultipart_boundarytkw((s3/usr/lib/python2.7/site-packages/urllib3/request.pyturlopen.scKs]|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(RR R RRt urlopen_kw((s3/usr/lib/python2.7/site-packages/urllib3/request.pytrequest4s cKs0|r|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. t?(RR(RR R RR((s3/usr/lib/python2.7/site-packages/urllib3/request.pyRJsc KsÉ|dkr|j}niid6}|r˜d|krFtdƒ‚n|rgt|d|ƒ\} } nt|ƒd} } | |ds