Add return type field to entry-point docstrings
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Ulrich Petri · committed by Ulrich Petri · parent bc746e1 · Browse files · 2 files·+24 added−8 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Fixes: #2483
Diff stats
2 files+24 added−8 removed
- other:+24 added−8 removed
Provenance
- Commit
573d460- Tree
0d826ad- Author
Ulrich Petri <ulo@ulo.pe>- Committer
Ulrich Petri <ulo@ulo.pe>- Parent
bc746e1
2 files changed+24 added−8 removed
modified:requests/api.py+23 added-8 removed
14 unmodified lines15 16 17 def request(method, url, **kwargs):18 """Constructs and sends a :class:`Request <Request>`.19- Returns :class:`Response <Response>` object.19 20 :param method: method for the new :class:`Request` object.21 :param url: URL for the new :class:`Request` object.22 :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.12 unmodified lines35 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.36 :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.37 :param stream: (optional) if ``False``, the response content will be immediately downloaded.38 :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.39+ :return: :class:`Response <Response>` object40+ :rtype: requests.Response41 42 Usage::43 44 >>> import requests10 unmodified lines55 return response56 57 58 def get(url, **kwargs):58- """Sends a GET request. Returns :class:`Response` object.59+ """Sends a GET request.60 61 :param url: URL for the new :class:`Request` object.62 :param \*\*kwargs: Optional arguments that ``request`` takes.63+ :return: :class:`Response <Response>` object64+ :rtype: requests.Response65 """66 67 kwargs.setdefault('allow_redirects', True)68 return request('get', url, **kwargs)69 70 71 def options(url, **kwargs):69- """Sends a OPTIONS request. Returns :class:`Response` object.72+ """Sends a OPTIONS request.73 74 :param url: URL for the new :class:`Request` object.75 :param \*\*kwargs: Optional arguments that ``request`` takes.76+ :return: :class:`Response <Response>` object77+ :rtype: requests.Response78 """79 80 kwargs.setdefault('allow_redirects', True)81 return request('options', url, **kwargs)82 83 84 def head(url, **kwargs):80- """Sends a HEAD request. Returns :class:`Response` object.85+ """Sends a HEAD request.86 87 :param url: URL for the new :class:`Request` object.88 :param \*\*kwargs: Optional arguments that ``request`` takes.89+ :return: :class:`Response <Response>` object90+ :rtype: requests.Response91 """92 93 kwargs.setdefault('allow_redirects', False)94 return request('head', url, **kwargs)95 96 97 def post(url, data=None, json=None, **kwargs):91- """Sends a POST request. Returns :class:`Response` object.98+ """Sends a POST request.99 100 :param url: URL for the new :class:`Request` object.101 :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.102 :param json: (optional) json data to send in the body of the :class:`Request`.103 :param \*\*kwargs: Optional arguments that ``request`` takes.104+ :return: :class:`Response <Response>` object105+ :rtype: requests.Response106 """107 108 return request('post', url, data=data, json=json, **kwargs)109 110 111 def put(url, data=None, **kwargs):103- """Sends a PUT request. Returns :class:`Response` object.112+ """Sends a PUT request.113 114 :param url: URL for the new :class:`Request` object.115 :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.116 :param \*\*kwargs: Optional arguments that ``request`` takes.117+ :return: :class:`Response <Response>` object118+ :rtype: requests.Response119 """120 121 return request('put', url, data=data, **kwargs)122 123 124 def patch(url, data=None, **kwargs):114- """Sends a PATCH request. Returns :class:`Response` object.125+ """Sends a PATCH request.126 127 :param url: URL for the new :class:`Request` object.128 :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.129 :param \*\*kwargs: Optional arguments that ``request`` takes.130+ :return: :class:`Response <Response>` object131+ :rtype: requests.Response132 """133 134 return request('patch', url, data=data, **kwargs)135 136 137 def delete(url, **kwargs):125- """Sends a DELETE request. Returns :class:`Response` object.138+ """Sends a DELETE request.139 140 :param url: URL for the new :class:`Request` object.141 :param \*\*kwargs: Optional arguments that ``request`` takes.142+ :return: :class:`Response <Response>` object143+ :rtype: requests.Response144 """145 146 return request('delete', url, **kwargs)modified:AUTHORS.rst+1 added
157 unmodified lines158 - Joe Alcorn (`@buttscicles <https://github.com/buttscicles>`_)159 - Syed Suhail Ahmed <ssuhail.ahmed93@gmail.com> (`@syedsuhail <https://github.com/syedsuhail>`_)160 - Scott Sadler (`@ssadler <https://github.com/ssadler>`_)161 - Arthur Darcet (`@arthurdarcet <https://github.com/arthurdarcet>`_)162+- Ulrich Petri (`@ulope <https://github.com/ulope>`_)