Skip to content
Myr

someone stole the cookie jar

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent fa2f1c5 · Browse files · 1 file+9 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−8 removed

  • other:+9 added−8 removed

1 file+9 added−8 removed

modified:requests/core.py+9 added-8 removed
109 unmodified lines
110 """Creates appropriate opener object for urllib2."""111112 _handlers = []113114 if self.cookiejar != None:114 if self.cookiejar:115 _handlers.append(urllib2.HTTPCookieProcessor(self.cookiejar))116117 if self.auth:118 if not isinstance(self.auth.handler, (urllib2.AbstractBasicAuthHandler, urllib2.AbstractDigestAuthHandler)):
69 unmodified lines
188 try:189 opener = self._get_opener()190 resp = opener(req)191192 if self.cookiejar != None:192 if self.cookiejar:193 self.cookiejar.extract_cookies(resp, req)194 195 except urllib2.HTTPError, why:196 self._build_response(why)197 self.response.error = why198 else:
213 unmodified lines
412 """413 data = kwargs.pop('data', dict()) or kwargs.pop('params', dict())414415 r = Request(method=method, url=url, data=data, headers=kwargs.pop('headers', {}),415 cookiejar=kwargs.pop('cookiejar', None), files=kwargs.pop('files', None),416 cookiejar=kwargs.pop('cookies', None), files=kwargs.pop('files', None),417 auth=kwargs.pop('auth', auth_manager.get_auth(url)))418 r.send()419420 return r.response
8 unmodified lines
429 :param cookies: (optional) CookieJar object to send with the :class:`Request`.430 :param auth: (optional) AuthObject to enable Basic HTTP Auth.431 """432 432 return request('GET', url, params=params, headers=headers, cookiejar=cookies, auth=auth)433 return request('GET', url, params=params, headers=headers, cookies=cookies, auth=auth)434435436def head(url, params={}, headers={}, cookies=None, auth=None):437 """Sends a HEAD request. Returns :class:`Response` object.
4 unmodified lines
442 :param cookies: (optional) CookieJar object to send with the :class:`Request`.443 :param auth: (optional) AuthObject to enable Basic HTTP Auth.444 """445445 return request('HEAD', url, params=params, headers=headers, cookiejar=cookies, auth=auth)446 return request('HEAD', url, params=params, headers=headers, cookies=cookies, auth=auth)447448449def post(url, data={}, headers={}, files=None, cookies=None, auth=None):450 """Sends a POST request. Returns :class:`Response` object.
5 unmodified lines
456 :param cookies: (optional) CookieJar object to send with the :class:`Request`.457 :param auth: (optional) AuthObject to enable Basic HTTP Auth.458 """459459 return request('POST', url, data=data, headers=headers, files=files, cookiejar=cookies, auth=auth)460 return request('POST', url, data=data, headers=headers, files=files, cookies=cookies, auth=auth)461462463def put(url, data='', headers={}, files={}, cookies=None, auth=None):464 """Sends a PUT request. Returns :class:`Response` object.
5 unmodified lines
470 :param cookies: (optional) CookieJar object to send with the :class:`Request`.471 :param auth: (optional) AuthObject to enable Basic HTTP Auth.472 """473473 return request('PUT', url, data=data, headers=headers, files=files, cookiejar=cookies, auth=auth)474 return request('PUT', url, data=data, headers=headers, files=files, cookies=cookies, auth=auth)475476477def delete(url, params={}, headers={}, cookies=None, auth=None):478 """Sends a DELETE request. Returns :class:`Response` object.
4 unmodified lines
483 :param cookies: (optional) CookieJar object to send with the :class:`Request`.484 :param auth: (optional) AuthObject to enable Basic HTTP Auth.485 """486486 return request('DELETE', url, params=params, headers=headers, cookiejar=cookies, auth=auth)487 return request('DELETE', url, params=params, headers=headers, cookies=cookies, auth=auth)488489490491class RequestException(Exception):
11 unmodified lines