How to consume Data from a Web API using Blazor WebAssembly

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

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

  • @davestorm6718
    @davestorm6718 2 года назад +4

    Love it! I did not know about Paste JSON as Classes in Visual Studio! What a time saver! Thanks!!!

  • @broadshare
    @broadshare 2 года назад +1

    I am an experienced c# developer but I always learn a lot from you Pat, thank you so much

  • @hamgaiteen8897
    @hamgaiteen8897 2 года назад +1

    any suggestion on the secure the API with secret, Pat?

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

    Great vid.👍😁 I'm a bit new to blazor web assembly. Can a web assembly consume multiple Web Api base addresses?
    Let's say the app is consuming 1 web api from amazon and another web api from Microsoft. Is that possible? Thanks.

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

    Do you need to worry about CORS in order to call an external REST API?

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

      Yes, it is the responsibility of the REST API to enable CORS

    • @TheDuerden
      @TheDuerden Год назад +1

      @@TechWithPat Thank you for this comment, I have been banging my head against CORS errors for a few hours reading through a lot of Microsoft documentation - and it is nice to have confirmed the conclusion that I had come to...

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

      @@TechWithPat so your demo did not seem to specify anything related to CORS. Are you saying the rapidapi site has already done CORS configuration for you? In my example, I'm getting CORS error when trying to call an external api from my visual studio project and I'm not sure how to fix it.

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

      @@philipkeefer5948 I think RapidAPI sets the Access-Control-Allow-Origin header to "*" in the response, allowing any origin to make API requests without triggering a CORS error.
      If you're getting CORS error, check API documentation for specific CORS requirements to follow.