diff --git a/.gitignore b/.gitignore index cd0c32e9..0f175468 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ requests.egg-info/ *.swp *.egg env/ +.eggs/ .workon diff --git a/AUTHORS.rst b/AUTHORS.rst index 3571fd53..3e8f36c2 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -190,3 +190,4 @@ Patches and Suggestions - Rajiv Mayani (`@mayani `_) - Antti Kaihola (`@akaihola `_) - Belavin Denis (`@luckydenis `_) +- Dull Bananas (`@dullbananas `_) diff --git a/HISTORY.md b/HISTORY.md index 0b1f9f5e..af0cfffe 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -549,7 +549,7 @@ Or, even better: **Bugfixes** -- For file-like objects that are not seeked to the very beginning, we +- For file-like objects that are not sought to the very beginning, we now send the content length for the number of bytes we will actually read, rather than the total size of the file, allowing partial file uploads. diff --git a/docs/dev/contributing.rst b/docs/dev/contributing.rst index d1171cb9..434dc565 100644 --- a/docs/dev/contributing.rst +++ b/docs/dev/contributing.rst @@ -130,7 +130,14 @@ the Requests codebase:: foo = long_function_name(var_one, var_two, var_three, var_four) -No. Just don't. Please. +No. Just don't. Please. This is much better:: + + foo = long_function_name( + var_one, + var_two, + var_three, + var_four, + ) Docstrings are to follow the following syntaxes:: diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index f1b7460d..fce37dc4 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -193,7 +193,7 @@ When you are using the prepared request flow, keep in mind that it does not take This can cause problems if you are using environment variables to change the behaviour of requests. For example: Self-signed SSL certificates specified in ``REQUESTS_CA_BUNDLE`` will not be taken into account. As a result an ``SSL: CERTIFICATE_VERIFY_FAILED`` is thrown. -You can get around this behaviour by explicity merging the environment settings into your session:: +You can get around this behaviour by explicitly merging the environment settings into your session:: from requests import Request, Session diff --git a/requests/api.py b/requests/api.py index ef71d075..232b01d9 100644 --- a/requests/api.py +++ b/requests/api.py @@ -16,7 +16,7 @@ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request `. - :param method: method for the new :class:`Request` object. + :param method: method for the new :class:`Request` object: ``GET``, ``OPTIONS`, ``HEAD``, ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. :param url: URL for the new :class:`Request` object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:`Request`. @@ -92,7 +92,9 @@ def head(url, **kwargs): r"""Sends a HEAD request. :param url: URL for the new :class:`Request` object. - :param \*\*kwargs: Optional arguments that ``request`` takes. + :param \*\*kwargs: Optional arguments that ``request`` takes. If + `allow_redirects` is not provided, it will be set to `False` (as + opposed to the default :meth:`request` behavior). :return: :class:`Response ` object :rtype: requests.Response """