Dynamic module http

Index

Variables

Variables

defaultJSONPCallbackParam: string

the default is 'callback'

get: (url: string, query: Object) => JQueryPromise<any>

Performs an HTTP GET request on the specified URL. This function returns a promise which resolves with the returned response data. You can optionally return a query object whose properties will be used to construct a query string.

jsonp: (url: string, query: Object, callbackParam: string) => JQueryPromise<any>

Performs a JSONP request to the specified url. You can optionally include a query object whose properties will be used to construct the query string. Also, you can pass the name of the API's callback parameter. If none is specified, it defaults to "callback". This api returns a promise. If you are using a callback parameter other than "callback" consistently throughout your application, then you may want to set the http module's defaultJSONPCallbackParam so that you don't need to specify it on every request.

post: (url: string, data: Object) => JQueryPromise<any>

Performs an HTTP POST request on the specified URL with the supplied data. The data object is converted to JSON and the request is sent with an application/json content type. Thie function returns a promise which resolves with the returned response data.