cookies system in place.
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 5fe24ab · Browse files · 1 file·+10 added−5 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+10 added−5 removed
- other:+10 added−5 removed
Provenance
- Commit
f023c81- Tree
545deaa- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent
5fe24ab
1 file changed+10 added−5 removed
modified:requests/core.py+10 added-5 removed
280 unmodified lines281 self.password = password282 283 284 285-def get(url, params={}, headers={}, auth=None):285+def get(url, params={}, headers={}, cookies=None, auth=None):286 """Sends a GET request. Returns :class:`Response` object.287 288 :param url: URL for the new :class:`Request` object.289 :param params: (optional) Dictionary of GET Parameters to send with the :class:`Request`.6 unmodified lines296 r.method = 'GET'297 r.url = url298 r.params = params299 r.headers = headers300+ r.cookiejar = cookies301 r.auth = _detect_auth(url, auth)302 303 r.send()304 305 return r.response306 307 307-def head(url, params={}, headers={}, auth=None):308+def head(url, params={}, headers={}, cookies=None, auth=None):309 """Sends a HEAD request. Returns :class:`Response` object.310 311 :param url: URL for the new :class:`Request` object.312 :param params: (optional) Dictionary of GET Parameters to send with the :class:`Request`.7 unmodified lines320 r.url = url321 # return response object322 r.params = params323 r.headers = headers324+ r.cookiejar = cookies325 r.auth = _detect_auth(url, auth)326 327 r.send()328 329 return r.response330 331 330-def post(url, data={}, headers={}, files=None, auth=None):332+def post(url, data={}, headers={}, files=None, cookies=None, auth=None):333 """Sends a POST request. Returns :class:`Response` object.334 335 :param url: URL for the new :class:`Request` object.336 :param data: (optional) Dictionary of POST Data to send with the :class:`Request`.11 unmodified lines348 if files:349 r.files = files350 351 r.headers = headers352+ r.cookiejar = cookies353 r.auth = _detect_auth(url, auth)354 355 r.send()356 357 return r.response358 359 357-def put(url, data='', headers={}, files={}, auth=None):360+def put(url, data='', headers={}, files={}, cookies=None, auth=None):361 """Sends a PUT request. Returns :class:`Response` object.362 363 :param url: URL for the new :class:`Request` object.364 :param data: (optional) Bytes of PUT Data to send with the :class:`Request`.8 unmodified lines373 r.method = 'PUT'374 r.data = data375 r.files = files376 r.headers = headers377+ r.cookiejar = cookies378 r.auth = _detect_auth(url, auth)379 380 r.send()381 382 return r.response383 384 381-def delete(url, params={}, headers={}, auth=None):385+def delete(url, params={}, headers={}, cookies=None, auth=None):386 """Sends a DELETE request. Returns :class:`Response` object.387 388 :param url: URL for the new :class:`Request` object.389 :param params: (optional) Dictionary of GET Parameters to send with the :class:`Request`.6 unmodified lines396 r.url = url397 r.method = 'DELETE'398 399 r.headers = headers400+ r.cookiejar = cookies401 r.auth = _detect_auth(url, auth)402 403 r.send()404 53 unmodified lines