I am trying to make a POST request with the header x-www-form-urlencoded as follows:
login(username, password): Observable<any> { return this.http.post('/login', { username: username, password: password }, { headers: new HttpHeaders() .set('Content-Type', 'x-www-form-urlencoded') } );
Unfortunately, my API says that I sent an empty username and password.
so I decided to make a postman request to my endpoint entry and see where this problem came from, and the postman request returned a username and password.
How is it that when I send mail from a mailbox, my API returns my username and password, and when I send a message from my Angular application, my API returns empty values? Is there something I am missing?
source share