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

Комментарии • 13

  • @punjdeya2634
    @punjdeya2634 9 месяцев назад

    beautiful explanation...I have gone through a lot of videos but this was the simplest one to understand

    • @sudomateo
      @sudomateo  9 месяцев назад

      Thank you! I'm here to help!

  • @againstthegrain5914
    @againstthegrain5914 2 года назад +8

    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

    • @sudomateo
      @sudomateo  Год назад +2

      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.

  • @Tobsson
    @Tobsson Год назад +2

    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?

    • @sudomateo
      @sudomateo  Год назад

      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.

  • @Hdhillon09
    @Hdhillon09 Год назад

    Great content Matthew, Thank you for that in depth explanation!

  • @CyberAbyss007
    @CyberAbyss007 Год назад

    Thank you! Great video!

  • @dennisbautz5749
    @dennisbautz5749 2 года назад +2

    Lifesaver, I was checking my client code instead of the api code, holy. Thank you so much

  • @damolataiwo8638
    @damolataiwo8638 Год назад

    Thanks for this

  • @BillBrutzman
    @BillBrutzman Год назад

    Very helpful _ golden.