I\'ve a problem when I try to do PATCH request in an angular 7 web application. In my backend I have:
app.use((re
Your error:
Access to XMLHttpRequest at 'my_url' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
My error:
Access to XMLHttpRequest at 'localhost:3000/api/todo' from origin 'http://localhost:4200' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
(Even though a bit different error but i'll answer anyway)
Now two questions here:
Ans. Putting 'http://' before api i used, means 'http://localhost:3000/api/todo'.
Ans. Can't say for sure but i dont see your api url instead it says 'my_url' (comparing both errors). I thik you may've passed string instead of variable.
I'll be happy if this helps anyone. Because this cost me almost 2hr and now it's midnight(almost).