Retrieving data from a Web API
A Web API (Web Application Programming Interface) is a HTTP API that is created using the .NET framework. It uses the HTTP protocol to return data. Since HTTP is available universally across a wide range of platforms, these APIs can be used on Web and mobile platforms and across various devices.
In this example, we will use jQuery Ajax to post a request to a Web API. The constructs used in this example are summarized in the following table:
Construct |
Type |
Description |
---|---|---|
|
jQuery selector |
This selects an element based on its ID. |
|
jQuery selector |
This selects all elements with the specified HTML tag. |
|
jQuery function |
This loads the JSON data from the server using the HTTP |
|
jQuery method |
This inserts content at the end of each matched element. |
|
jQuery event |
This is fired when you click on an element. It corresponds to the JavaScript |
|