diff --git a/lib/ansible/modules/extras/windows/win_uri.ps1 b/lib/ansible/modules/extras/windows/win_uri.ps1 index b02418e891..d701ef56b9 100644 --- a/lib/ansible/modules/extras/windows/win_uri.ps1 +++ b/lib/ansible/modules/extras/windows/win_uri.ps1 @@ -65,6 +65,11 @@ if ($headers -ne $null) { $webrequest_opts.Headers = $req_headers } +if ($body -ne $null) { + $webrequest_opts.Body = $body + Set-Attr $result.win_uri "body" $body +} + try { $response = Invoke-WebRequest @webrequest_opts } catch { diff --git a/lib/ansible/modules/extras/windows/win_uri.py b/lib/ansible/modules/extras/windows/win_uri.py index 7045f70bd4..c65f3ab536 100644 --- a/lib/ansible/modules/extras/windows/win_uri.py +++ b/lib/ansible/modules/extras/windows/win_uri.py @@ -120,6 +120,11 @@ use_basic_parsing: returned: always type: bool sample: True +body: + description: The content of the body used (added in version 2.2) + returned: when body is specified + type: string + sample: '{"id":1}' status_code: description: The HTTP Status Code of the response. returned: success