I have a problem with this CURL request. It works fine if I send it over terminal but when I convert it to Angular HTTP Client call it doesn't work.
Curl:
curl --location --request PUT '<some_url>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"status": "CONFIRMED"
}'
Angular:
const headers = new HttpHeaders()
.set('Content-Type', 'application/json')
.set('Accept', 'application/json; charset=UTF-8');
const b = {
status: 'CONFIRMED'
};
return this.http.put(some_url, b, { headers });
Error: Access to <some_url> from origin 'http://localhost:4200' has been blocked by CORS policy: Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.