Describe the issue/error/question
Hello, I’m creating a Angular application and I need to make API calls with webhooks on n8n. When I make a call to a webhook, I have an error like “Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘localhost:8800’”
What I did until now ?
When I had this error the first time, I added the response header "Access-Control-Allow-Origin : * " to the webhook, and it worked but only for a webhook with the GET HTTP Method. But when I tried with a POST HTTP Method, I have the error again… So I don’t know what I can do…
(I hope I am understandable ^^ ask if you have any question )
What is the error message (if any)? (On the web browser)
Object { headers: {…}, status: 0, statusText: “Unknown Error”, url: “[link]”, ok: false, name: “HttpErrorResponse”, message: “Http failure response for [link]: 0 Unknown Error”, error: error }
error: error { target: XMLHttpRequest, isTrusted: true, lengthComputable: false, … }
headers: Object { normalizedNames: Map(0), lazyUpdate: null, headers: Map(0) }
message: “Http failure response for [link]: 0 Unknown Error”,
name: “HttpErrorResponse”,
ok: false,
status: 0,
statusText: “Unknown Error”,
url: “[link]”
Please share the workflow
Code of the call in Angular
this.httpClient.post<any>(environment.apiMCURLTest + '72b8d0b4-3777-4246-b1f3-7f2980169f09', {'pseudo':player}).subscribe(
(response)=>{
console.log(response)
}
)
Share the output returned by the last node
No output from the node. The webhook is not triggered.
Information on your n8n setup
- n8n version: 0.182.1
- Database you’re using (default: SQLite): SQLite
- Running n8n with the execution process [own(default), main]: own ??
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker