title: How to download a file using http.post with url encoded body in flutter?
body: <p>I want to build a web app to download a pdf file in flutter using http.post method, I have already searched the internet for it but I still can't download the file. I have already tried in postman with raw json (then send and download) it works but can't do it in flutter.</p>
  <pre><code>Future&lt;File&gt; postRequest() async {
    var url = 'xxxxxxx'; &lt;- example url
  
    Map dat = {
      &quot;FileName&quot; : &quot;itsPdf.pdf&quot;
    };
  
    File file;
    var body = json.encode(dat);
  
    var response = await http.post(Uri.parse(url),
        headers: {&quot;Accept&quot;: &quot;application/json&quot;,
            &quot;content-type&quot;: &quot;application/json&quot;},
        body: body
    );
  
    print(response.statusCode);
    if(response.statusCode == 200) {
      file = json.decode(response.body) as File;
      return file;
    } else {
      print(&quot;ERROR&quot;);
    }
  }
  </code></pre>
  <p>status code = 200</p>
  <p><code>Error: FormatException: SyntaxError: Unexpected token % in JSON at position 0</code></p>