简体   繁体   中英

Consuming external API

I'm a PHP developer, learning Umbraco and ASP.NET. I consumed an external API before using Guzzle in Laravel, however everything I found so far on Umbraco is very different to what I'm used to.

Now I'd like to consume external API in Umbraco, and return JSON objects into views. For example, one JSON object is an event (a concert or a sport event) which contains values like image, date, description. These will be passed into a view. I should be able to do this once I wrap my head around how to consume the API.

How would I consume external API on Umbraco? I'm unsure where to start. Are there any good tutorials available out there?

On server side you can look at this library Restsharp that helps you to consume external http or rest api. You can easily install it via nuget.

For client side you can use JQuery to do Ajax call but need to take into considering CORS .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM