Dynamic module ttp

Index

Variables

Functions

Variables

callbackParam: string

The name of the callback parameter to inject into jsonp requests by default.

default

callback

Functions

get(url: string, query?: Object, headers?: Object): JQueryPromise

Makes an HTTP GET request.

Parameters

  • url: string

    The url to send the get request to.

  • query?: Object optional
  • headers?: Object optional

Returns

JQueryPromise

A promise of the get response data.

jsonp(url: string, query?: Object, callbackParam?: string, headers?: Object): JQueryPromise

Makes an JSONP request.

Parameters

  • url: string

    The url to send the get request to.

  • query?: Object optional
  • callbackParam?: string optional
  • headers?: Object optional

Returns

JQueryPromise

A promise of the response data.

post(url: string, data: Object, headers?: Object): JQueryPromise

Makes an HTTP POST request.

Parameters

  • url: string

    The url to send the post request to.

  • data: Object

    The data to post. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization.

  • headers?: Object optional

Returns

JQueryPromise

A promise of the response data.

put(url: string, data: Object, headers?: Object): JQueryPromise

Makes an HTTP PUT request.

method

put

Parameters

  • url: string

    The url to send the put request to.

  • data: Object

    The data to put. It will be converted to JSON. If the data contains Knockout observables, they will be converted into normal properties before serialization.

  • headers?: Object optional

Returns

JQueryPromise

A promise of the response data.

remove(url: string, query?: Object, headers?: Object): JQueryPromise

Makes an HTTP DELETE request.

method

remove

Parameters

  • url: string

    The url to send the delete request to.

  • query?: Object optional
  • headers?: Object optional

Returns

JQueryPromise

A promise of the get response data.

toJSON(data: Object): string

Converts the data to JSON.

Parameters

  • data: Object

    The data to convert to JSON.

Returns

string

JSON.