Using Angular 10 and HttpClient with following data:
const data = {
'username': username,
'password': password
};
const headers = { 'content-type': 'application/json'}
const body = JSON.stringify(data);
return this.httpClient.post(endPointURL, body,{'headers':headers})
On endPointURL I can see body details as null. But if I remove header like this:
return this.httpClient.post(endPointURL, body)
I can see body details correct. I need to implement body data and header. Could you please let me know what am I doing wrong?