i am trying to make a post request to URL = "https://sambhav.daily.co/v1/rooms"
but i am receiving the error blocked by cors policy
addRoom(): Observable<any> {
const headers = new HttpHeaders()
.set("content-type", "application/json")
.set("Access-Control-Allow-Origin", "http://localhost:8000")
.set("Access-Control-Allow-Methods", "GET,POST,PATCH,DELETE,PUT,OPTIONS")
.set(
"Access-Control-Allow-Headers",
"Origin, Content-Type, X-Auth-Token, content-type"
)
.set(
"Authorization",
`Bearer <API-KEY>`
);
return this.http
.post(URL, { headers: headers })
.map((response: any) => response.data)
.catch(this.handleError);
}
the error i am receiving
Access to XMLHttpRequest at 'https://sambhav.daily.co/v1/rooms' from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.