title: Issues using Ansible URI module - Getting 401 even when authentication credentials are added
body: <p>I am using Ansible's URI module to call a simple GET endpoint but I am getting a 401 error message as shown below.</p>
  <p><a href="https://i.stack.imgur.com/lgXPB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lgXPB.png" alt="enter image description here" /></a></p>
  <p>Here is the playbook configuration</p>
  <pre><code>  - name: Elasticsearch Cluster health Check
      uri:
        url: https://elastichost:9200/_cluster/health?&amp;pretty
        url_password : xxxxxxx
        url_username : xxxxxx
        validate_certs : no
        method: GET
        body_format: json
        force_basic_auth: yes
        return_content: yes
        headers:
           Content-Type: &quot;application/json&quot; 
      register: showhealth
      tags: NonProd
  
    - name: Show Elasticsearch Health
      debug: var=showhealth  
      tags: NonProd
  </code></pre>
  <p>Any inputs on how to resolve</p>