mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 12:03:58 -07:00
* 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:
parent
0988de8c4c
commit
d25a70846f
2 changed files with 21 additions and 2 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue