JavaScript Fetch API and Cross-Origin Resource Sharing (CORS)
HTML-код
- Опубликовано: 16 окт 2024
- A brief overview of how Cross-Origin Resource Sharing (CORS) affects using the JavaScript Fetch API. I was a part of the #100Devs 2022 cohort and I saw fellow classmates struggling with CORS errors so I wanted to make a brief video explaining what CORS is and what can be done about it when using the JavaScript Fetch API.
GitHub: github.com/sud...
LinkedIn: / sudomateo
Twitter: / sudomateo
beautiful explanation...I have gone through a lot of videos but this was the simplest one to understand
Thank you! I'm here to help!
this was a waste of time. you just showed everyone you didnt get any errors when you changed URL's. Would had been nice to see ya implement that into some code
This video was focused on explaining what CORS is and the options clients can take when interacting with a server that is not properly setting CORS headers. It was not focused on implementing the server code.
But if you REALLY want to use that API that don't follow the CORS standard, how do you do it from a pure client application?
You can't. The browser won't let you do that. The HTTP clients are happy to connect to whatever endpoint you want but the browser is the one that'll deny it based on CORS.
Great content Matthew, Thank you for that in depth explanation!
Thank you! Great video!
Lifesaver, I was checking my client code instead of the api code, holy. Thank you so much
Thanks for this
You're welcome!
Very helpful _ golden.