diff --git a/lib/ansible/modules/network/basics/uri.py b/lib/ansible/modules/network/basics/uri.py index 356993e3cf7..9f1cd36da77 100644 --- a/lib/ansible/modules/network/basics/uri.py +++ b/lib/ansible/modules/network/basics/uri.py @@ -413,6 +413,9 @@ def main(): # currently a bit ugly. (e.g. headers='{"Content-Type":"application/json"}') for key, value in six.iteritems(module.params): if key.startswith("HEADER_"): + module.deprecate('Supplying headers via HEADER_* is deprecated and ' + 'will be removed in a future version. Please use ' + '`headers` to supply headers for the request') skey = key.replace("HEADER_", "") dict_headers[skey] = value diff --git a/test/integration/targets/uri/tasks/main.yml b/test/integration/targets/uri/tasks/main.yml index f9fd00bec24..30fd46eb139 100644 --- a/test/integration/targets/uri/tasks/main.yml +++ b/test/integration/targets/uri/tasks/main.yml @@ -180,7 +180,8 @@ url: 'http://{{ httpbin_host }}/digest-auth/auth/user/passwd' user: user password: passwd - HEADER_Cookie: "fake=fake_value" + headers: + Cookie: "fake=fake_value" - name: test PUT uri: