summaryrefslogtreecommitdiff
path: root/test/integration/targets/win_uri
diff options
context:
space:
mode:
authorNate <natewilliamschen@gmail.com>2018-03-25 14:35:41 -0500
committerJordan Borean <jborean93@gmail.com>2018-03-26 05:35:41 +1000
commit2c44061a044ba5ae3f0648ea8d6f7ae5801e0922 (patch)
tree19408aa90e7060bb9e24049a7e0d83cb17c972a7 /test/integration/targets/win_uri
parentd502745a4e2184b566a9c150c5acb37827861b21 (diff)
downloadansible-2c44061a044ba5ae3f0648ea8d6f7ae5801e0922.tar.gz
append request headers instead of replacing (#37845)
Diffstat (limited to 'test/integration/targets/win_uri')
-rw-r--r--test/integration/targets/win_uri/tasks/test.yml21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/integration/targets/win_uri/tasks/test.yml b/test/integration/targets/win_uri/tasks/test.yml
index 206648d743..176e303e10 100644
--- a/test/integration/targets/win_uri/tasks/test.yml
+++ b/test/integration/targets/win_uri/tasks/test.yml
@@ -338,3 +338,24 @@
- invalid_path.content is defined
- invalid_path.method == 'GET'
- invalid_path.connection is defined
+
+- name: post request with custom headers
+ win_uri:
+ url: http://{{httpbin_host}}/post
+ method: POST
+ headers:
+ Test-Header: hello
+ Another-Header: world
+ content_type: application/json
+ body: '{"foo": "bar"}'
+ return_content: yes
+ register: post_request_with_custom_headers
+
+- name: assert post with custom headers
+ assert:
+ that:
+ - not post_request_with_custom_headers.changed
+ - post_request_with_custom_headers.status_code == 200
+ - post_request_with_custom_headers.json.headers['Content-Type'] == "application/json"
+ - post_request_with_custom_headers.json.headers['Test-Header'] == 'hello'
+ - post_request_with_custom_headers.json.headers['Another-Header'] == 'world'