Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling Web API from an ASP.NET page
Message
From
20/04/2017 11:31:18
 
General information
Forum:
ASP.NET
Category:
Web Services
Miscellaneous
Thread ID:
01650481
Message ID:
01650483
Views:
43
>Hi,
>
>I am attempting to learn how to use a Web API (created by another party) can be used in an ASP.NET application. I have used this Web API in a VFP application. In summary this is what I do in VFP application:
>1. Create a JSON with IDs and value pairs (that need to be passed to the Web API)
>2. Create a wwHTTP object, based on the West-Wind wwHTTP.PRG
>3. Call httpget or httppost method of the wwHTTP object and pass the end point of the Web API
>4. Check Response string returned by the httpget, which tell the app if successful or not
>
>Would the steps in the ASP.NET application be the same? And if yes, how would I create a HTTP object (step 2 above) in the ASP.NET application? Does .NET have a namespace/class for that?
>
>TIA for any input or suggestions

You can just use HttpClient with PostAsJsonAsync or GetAsync/ReadAsSync.

Simple example: https://docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform