5.20203.748
5.20203.748

httpRequest

HTTP requests are the basic mechanism used by web applications to exchange data with the server.

Many JavaScript toolkits and frameworks have their own wrappers for making HTTP requests. For example, Angular has an $http service, and jQuery has an ajax() method. If you have a favorite you can use that with Wijmo.

If you want to reduce dependencies on external toolkits and frameworks, you can use Wijmo's simple and flexible httpRequest method instead.

Example
wijmo.httpRequest('http://services.odata.org/Northwind/Northwind.svc/Customers?$format=json', {
  success: function (xhr) {
    var response = JSON.parse(xhr.responseText),
        customers = response.value;

    // do something with the customers...
  }
});