uri/win_uri: Make method a free text field (#49719)

* uri/win_uri: Make method a free text field

Since various interfaces introduce their own HTTP method (e.g. like
PROPFIND, LIST or TRACE) it's better to leave this up to the user.

* Fix HTTP method check in module_utils urls

* Add integration test for method UNKNOWN

* Clarify the change as requested during review
This commit is contained in:
Dag Wieers 2019-02-28 21:55:18 +01:00 committed by ansibot
parent 81ec48c7b4
commit 4e6c113bf0
7 changed files with 50 additions and 11 deletions

View file

@ -1128,8 +1128,6 @@ class Request:
urllib_request.install_opener(opener)
data = to_bytes(data, nonstring='passthru')
if method not in ('OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE', 'CONNECT', 'PATCH'):
raise ConnectionError('invalid HTTP request method; %s' % method)
request = RequestWithMethod(url, method, data)
# add the custom agent header, to help prevent issues