Skip to content

Commit d24a71b

Browse files
authored
Merge pull request #359 from hernandik/master
Clarify the parameter usage of 'allow_redirects' in documentation
2 parents b909e71 + d8c631c commit d24a71b

File tree

4 files changed

+226
-78
lines changed

4 files changed

+226
-78
lines changed

doc/RequestsLibrary.html

Lines changed: 216 additions & 68 deletions
Large diffs are not rendered by default.

src/RequestsLibrary/RequestsKeywords.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def session_less_get(self, url, params=None,
177177
| ``file-tuple`` | can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')`` or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers to add for the file. |
178178
| ``auth`` | Auth tuple to enable Basic/Digest/Custom HTTP Auth. |
179179
| ``timeout`` | How many seconds to wait for the server to send data before giving up, as a float, or a ``(connect timeout, read timeout)`` tuple. |
180-
| ``allow_redirects`` | Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``${True}``. |
180+
| ``allow_redirects`` | Boolean. Enable/disable (values ``${True}`` or ``${False}``) GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``${True}``. |
181181
| ``proxies`` | Dictionary mapping protocol or protocol and host to the URL of the proxy (e.g. {'http': 'foo.bar:3128', 'http://host.name': 'foo.bar:4012'}) |
182182
| ``verify`` | Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to ``${True}``. Warning: if a session has been created with ``verify=${False}`` any other requests will not verify the SSL certificate. |
183183
| ``stream`` | if ``${False}``, the response content will be immediately downloaded. |
@@ -256,8 +256,8 @@ def session_less_head(self, url,
256256
257257
The endpoint used to retrieve the HTTP headers is the ``url``.
258258
259-
``allow_redirects`` parameter is not provided, it will be set to `False` (as
260-
opposed to the default behavior).
259+
``allow_redirects`` parameter is not provided, it will be set to ``${False}`` (as
260+
opposed to the default behavior ``${True}``).
261261
262262
By default this keyword fails if a status code with error values is returned in the response,
263263
this behavior can be modified using the ``expected_status`` and ``msg`` parameters,

src/RequestsLibrary/RequestsOnSessionKeywords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ def head_on_session(self, alias, url,
154154
Session will be identified using the ``alias`` name.
155155
The endpoint used to retrieve the HTTP headers is the ``url``.
156156
157-
``allow_redirects`` parameter is not provided, it will be set to `False` (as
158-
opposed to the default behavior).
157+
``allow_redirects`` parameter is not provided, it will be set to ``${False}`` (as
158+
opposed to the default behavior ``${True}``).
159159
160160
By default this keyword fails if a status code with error values is returned in the response,
161161
this behavior can be modified using the ``expected_status`` and ``msg`` parameters,

src/RequestsLibrary/SessionKeywords.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def create_session(self,
140140
141141
``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided.
142142
143-
``debug`` Enable http verbosity option more information
143+
``debug`` Enable http verbosity option more information. Valid values are 0, 1, 2 ...
144144
https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.set_debuglevel
145145
146146
``max_retries`` Number of maximum retries each connection should attempt.
@@ -227,7 +227,7 @@ def create_client_cert_session(
227227
``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided.
228228
Defaults to False.
229229
230-
``debug`` Enable http verbosity option more information
230+
``debug`` Enable http verbosity option more information. Valid values are 0, 1, 2 ...
231231
https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.set_debuglevel
232232
233233
``max_retries`` Number of maximum retries each connection should attempt.
@@ -315,7 +315,7 @@ def create_custom_session(
315315
``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided.
316316
Defaults to False.
317317
318-
``debug`` Enable http verbosity option more information
318+
``debug`` Enable http verbosity option more information. Valid values are 0, 1, 2 ...
319319
https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.set_debuglevel
320320
321321
``max_retries`` Number of maximum retries each connection should attempt.
@@ -397,7 +397,7 @@ def create_digest_session(
397397
``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided.
398398
Defaults to False.
399399
400-
``debug`` Enable http verbosity option more information
400+
``debug`` Enable http verbosity option more information. Valid values are 0, 1, 2 ...
401401
https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.set_debuglevel
402402
403403
``max_retries`` Number of maximum retries each connection should attempt.
@@ -476,7 +476,7 @@ def create_ntlm_session(
476476
``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided.
477477
Defaults to False.
478478
479-
``debug`` Enable http verbosity option more information
479+
``debug`` Enable http verbosity option more information. Valid values are 0, 1, 2 ...
480480
https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.set_debuglevel
481481
482482
``max_retries`` Number of maximum retries each connection should attempt.

0 commit comments

Comments
 (0)