title: How to format long POST body string with Ansible URI Module?
body: <p>I need to issue a lot of POST requests as part of the Ansible playbook I'm putting together.  I'm using the uri module and need to send the data in the x-www-form-urlencoded format with the key/value pairs as shown from the example Ansible documentation below:</p>
  
  <pre><code>- uri:
      url: https://your.form.based.auth.example.com/index.php
      method: POST
      body: "name=your_username&amp;password=your_password&amp;enter=Sign%20in"
      status_code: 302
      headers:
        Content-Type: "application/x-www-form-urlencoded"
    register: login
  </code></pre>
  
  <p>My problem is that my body strings are very long, some with 20+ parameters as one large run-on line.  I'd like to be able to specify the parameters as a list such as:</p>
  
  <pre><code>body: 
    name: your_username
    password: your_password
    enter: SignIn
    ...
  </code></pre>
  
  <p>And have the result automatically sent in the same format (x-www-form-urlencoded, not JSON).  Is there an easy way to do this?</p>
  
  <p>Thanks!</p>