Only add Content-Type if not specified in headers. Fixes #20046 (#20234)

* Only add Content-Type if not specified in headers. Fixes #20046

* Update documentation to indicate body_format will not override Content-Type if specified in headers
This commit is contained in:
Matt Martz 2017-01-13 12:19:38 -06:00 committed by Brian Coca
commit d25a70846f
2 changed files with 21 additions and 2 deletions

View file

@ -280,3 +280,16 @@
status_code: 202
method: POST
body: foo
- name: Validate body_format json does not override content-type in 2.3 or newer
uri:
url: "https://{{ httpbin_host }}/post"
method: POST
body:
foo: bar
body_format: json
headers:
'Content-Type': 'text/json'
return_content: true
register: result
failed_when: result.json.headers['Content-Type'] != 'text/json'