title: Error while uploading .bin file using uri module in ansible playbook
body: <p>I am trying to do a post request which will upload a binary fil(.bin) using the URI module in my playbook. I am getting the below error.</p>
  <p>Ansible playbook :</p>
  <pre><code>- name: Play_manage Upload the upgrade file
    uri:
      url: &quot;{{ token_url.json.url }}&quot;
      user: &quot;admin&quot;
      password: &quot;admin@123&quot;
      method: POST
      return_content: true
      force_basic_auth: true
      status_code: 201,204,200
      headers:
        Content-Type: 'multipart/form-data'
        #Accept: application/json
      validate_certs: false
      body_format: json
      body: &quot;{{ lookup('file','{{ folder_path }}') }}&quot;
  </code></pre>
  <blockquote>
  <p>Error Message: fatal: [localhost]: FAILED! =&gt; {&quot;msg&quot;: &quot;An unhandled exception occurred while running the lookup plugin 'file'. Error was a &lt;type 'exceptions.UnicodeDecodeError'&gt;, original message: 'utf8' codec can't decode byte 0x90 in position 1: invalid start byte&quot;}</p>
  </blockquote>