I need to perform an HTTP request to log in to my ionic application, but my function needs to send the data as x-www-form-urlencoded, tried in several different ways but I have not yet been able to do it.
public login(credenciais):Observable<any>{
const formData = new FormData()
formData.append('email', credenciais.email);
formData.append('password', credenciais.password);
return this._http.post<any>(AppSettings.API_ENDPOINT + 'loginnovo',
formData, {observe: 'response'
}
)
}
In this way I get:
Http failure during parsing
I've also tried:
public login(credenciais):Observable<any>{
return this._http.post<any>(AppSettings.API_ENDPOINT + 'loginnovo',
{email: credenciais.password,
password: credenciais.password},
{observe: 'response'
}
)
}
This way I get an Http failure during parsing If I check in Request Payload, I have:
{email: "[email protected]", password: "1234"} email : "[email protected]" password : "1234"