Ionic post request error

hello , i’am trying to send a post request but i get this error
OPTIONS 400 (Bad Request)
Response for preflight does not have HTTP ok status.

this is my code

let data = JSON.stringify({
“pin”: pin,
“Serie”: num_serie,
“platform”: platform ,
“model” : model

var headers = new Headers();
headers.append(‘Content-Type’, ‘application/json’ );
const requestOptions = new RequestOptions({ headers: headers });

return“”, data, requestOptions)
.then(response => {
response.json() ;
console.log(response.json()) ;
.catch(error => console.log("Une erreur est survenue " + error));


can anyone help me ??

The issue is what is referred to as CORS or Cross Origin Resource Sharing. You should be able to google CORS and whatever backend you are using and it will provide guidance as to how you need to add verbs to the headers that will be returned to the client.

do u have an exemple or some thing similar i didin’t find something similar

Check this sit out: