Only assume GET if no data, otherwise POST (#43133)
* Only assume GET if no data, otherwise POST. Fixes #42876 #43091 #42750
This commit is contained in:
parent
0b77262288
commit
8d933928d2
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/fix-open-url.yml
Normal file
2
changelogs/fragments/fix-open-url.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- urls - Only assume GET method if data is empty, otherwise POST
|
|
@ -1136,7 +1136,7 @@ def open_url(url, data=None, headers=None, method=None, use_proxy=True,
|
||||||
|
|
||||||
Does not require the module environment
|
Does not require the module environment
|
||||||
'''
|
'''
|
||||||
method = method or 'GET'
|
method = method or ('POST' if data else 'GET')
|
||||||
return Request().open(method, url, data=data, headers=headers, use_proxy=use_proxy,
|
return Request().open(method, url, data=data, headers=headers, use_proxy=use_proxy,
|
||||||
force=force, last_mod_time=last_mod_time, timeout=timeout, validate_certs=validate_certs,
|
force=force, last_mod_time=last_mod_time, timeout=timeout, validate_certs=validate_certs,
|
||||||
url_username=url_username, url_password=url_password, http_agent=http_agent,
|
url_username=url_username, url_password=url_password, http_agent=http_agent,
|
||||||
|
|
Loading…
Reference in a new issue