HttpClient POST request using x-www-form-urlencoded : <p>I'm trying to make a POST request with <code>x-www-form-urlencoded</code>content type header as follows:</p>

<pre><code>login(username, password): Observable&lt;any&gt; {
    return this.http.post('/login', {
      username: username,
      password: password
      },
      {
        headers: new HttpHeaders()
          .set('Content-Type', 'x-www-form-urlencoded')
      }
      );
</code></pre>

<p>Unfortunately my API says that I sent empty username and password.</p>

<p>so I decided to make a postman request to my login endpoint and see where the problem comes from, and the postman request did return the username and password.</p>

<p>How comes that when I'm posting from postman my API return my username and password and when I post from my Angular app my API returns empty values? Is there anything I'm missing?</p>
