title: Form submit vs. Javascript POST Request
body: <p>I'm making a <code>POST</code> request with a very simple HTML <code>form</code>. The request fails in the <code>form</code> format, but works in Javascript.</p>
  
  <p>It's very simple, so here is almost the entire form:</p>
  
  <pre><code>&lt;form method="post" action="[apiUrl]" target="_blank"&gt;
    &lt;input type="hidden" name="payload" value="[payload]"&gt;
    &lt;!-- ... --&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><em>*Please note that <code>[apiUrl]</code> and <code>[payload]</code> are variables that are injected into the HTML.</em></p>
  
  <p>The request fails with a custom message from the API (seems it can't parse the payload):</p>
  
  <pre><code>{
    "Error": {
      "Message": "Noun and Verb are Required Request Parameters",
      "ValidationError": false
    },
    "Result": "ERROR"
  }
  </code></pre>
  
  <p>However, <strong>the exact same request will succeed when performed by Javascript</strong> (I've tested with both Axios and jQuery, and also with Paw).</p>
  
  <pre><code>$.post(this.apiUrl, this.payload, response =&gt; {
    console.log('Success!', response);
  });
  </code></pre>
  
  <p>The <code>payload</code> is just a Javascript <code>Object</code>. The variables are set like this:</p>
  
  <pre><code>this.apiUrl = request.url;
  this.payload = JSON.stringify(request.parameters);
  </code></pre>
  
  <p><strong>Why does it fail as a <code>form</code>?</strong></p>