diff options
author | Nate <natewilliamschen@gmail.com> | 2018-03-25 21:35:41 +0200 |
---|---|---|
committer | Jordan Borean <jborean93@gmail.com> | 2018-03-25 21:35:41 +0200 |
commit | 2c44061a044ba5ae3f0648ea8d6f7ae5801e0922 (patch) | |
tree | 19408aa90e7060bb9e24049a7e0d83cb17c972a7 /test/integration/targets/win_uri | |
parent | Disable unstable s3_bucket test. (diff) | |
download | ansible-2c44061a044ba5ae3f0648ea8d6f7ae5801e0922.tar.xz ansible-2c44061a044ba5ae3f0648ea8d6f7ae5801e0922.zip |
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.yml | 21 |
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' |