Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
514 views
in Technique[技术] by (71.8m points)

Blazor WebAssembly third party api

I am going to develop a Blazor application in WASM, I have to call a third party API which is not written in .net. The api is not on the same server as the WASM application and has CORS enabled. My question is:

I create the Blazor WASM application without .net core hosting and call the api directly using httpclient or I create it hosted in .net core and call the api using the controllers, if I use this approach I can protect the controllers with the token provided by the API from third parties? Which should I choose?

question from:https://stackoverflow.com/questions/65951330/blazor-webassembly-third-party-api

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

When CORS is configured correctly you should be able to call it directly from Blazor WebAssembly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...