Answer the question
In order to leave comments, you need to log in
How to send a valid header request via HttpClient?
Good afternoon, I'm sitting and I can not understand why the answer comes with an error. Already that only you can google everywhere the same answer. You need to send a post request with data and a specific header. Maybe someone knows how to solve the problem)?
requestData(): Observable<Object> {
let header = new HttpHeaders({
'Content-Type': 'application/json; charset=UTF-8'
})
return this.http.post('https://api3',
{
"login": "",
"pass": ""
},
{
headers: header
}
)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question