Monday, 31 December 2018

How JSONP works to call an ASP.NET Web API service in a cross domain?

JSONP wraps the data in a function. Due to this, we can make a cross-domain call for ASP.Net Web API calls.

JSONP will wrap the data in a function as shown below

CallbackFunction({
    "FirstName" : "Mark",
    "LastName"  : "Hastings",
    "Gender"    : "Male",
})

Below is simple JSON data. Compare this data with JSONP data.


{
    "FirstName" : "Mark",
    "LastName"  : "Hastings",
    "Gender"    : "Male",
}

No comments:

Post a Comment