I am trying to set header from http post call, But When I am consoling it to the log, It is printing undefined.
I tried the same for params also, but it is not getting set.
callAddGroupAPI(formId, data){
const headers = new Headers()
.set('Content-Type', 'application/json');
console.log(headers);
}
I am expecting output in the console to log the value of headers, But it is print undefined.
I have also tried
callAddGroupAPI(formId, data){
const headers = new Headers();
headers.append('Content-Type','application/json');
console.log(headers);
}
And this also is not working...
I am getting the same problem when I am using
const data = new FormData();
data.set('key', 'value')
console.log(data)
I have use .append() also, But that also is not working.