Generic call to the endpoint using the provided IEndpointCallParameters.
Internally, will decide which method to use to call the endpoint :
-- XMLHttpRequest for recent browser that support CORS, or if the endpoint is on the same origin.
-- XDomainRequest for older IE browser that do not support CORS.
-- Jsonp if all else fails, or is explicitly enabled.
The parameters to use for the call
A promise of the given type
Call the endpoint using Jsonp https://en.wikipedia.org/wiki/JSONP
Should be used for dev only, or for very special setup as using jsonp has a lot of drawbacks.
The info about the request
Call the endpoint using XDomainRequest https://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx
Used for IE8/9
The info about the request
Call the endpoint using XMLHttpRequest. Used internally by EndpointCaller.call.
Will try internally to handle error if it can.
Promise will otherwise fail with the error type.
The info about the request
The responseType. Default to text. https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType
Set this property to true to enable Jsonp call to the endpoint.
Be aware that jsonp is "easier" to setup endpoint wise, but has a lot of drawback and limitation for the client code.
Default to false.
Create a new EndpointCaller.
Specify the authentication that will be used for this endpoint. Not needed if the endpoint is public and has no authentication
This class is in charge of calling an endpoint (eg: a SearchEndpoint).
This means it's only uses to execute an XMLHttpRequest (for example), massage the response and check if there are errors.
Will execute the call and return a Promise.
Call using one of those options :