How to send data to api and connect headers IONIC 5

signIn(){
const headers = new HttpHeaders({
“Access-Control-Allow-Origin”:"*",
“Access-Control-Allow-Headers”:“Content-Type”,
“Access-Control-Allow-Methods”:“GET,POST,PUT, OPTIONS”,
“Access-Control-Allow-Credentials”: “true”,
“Content-Type”:“application/json”
});
let postData={
‘“username”’: this.user,
‘“password”’: this.pass
}
this.http.post(‘https://testapi.co.th/authen’,postData,{ headers: headers })
.subscribe(data => {
console.log(data);
}, error => {
console.log(error);
});
console.log(headers);
console.log(postData);

}
Capture_LI (2)

You need none of those custom headers on the client side. CORS must be dealt with on the server side.