Skip to content

Commit

Permalink
feat(http): add support for new methods (#2054)
Browse files Browse the repository at this point in the history
* feat(http): add patch request support (#2052)

* feat(http): add "disableRedirect" support (#2022)

* fix(http): remove obsolete "validateDomainName" function (#2053)
  • Loading branch information
silkimen authored and ihadeed committed Nov 9, 2017
1 parent 95daca1 commit d96d3ee
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/@ionic-native/plugins/http/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ export class HTTP extends IonicNativePlugin {
@Cordova({ sync: true })
removeCookies(url: string, cb: () => void): void { }

/**
* Disable following redirects automatically
* @param disable {boolean} Set to true to disable following redirects automatically
*/
@Cordova({ sync: true })
disableRedirect(disable: boolean): void { }

/**
* Set request timeout
* @param timeout {number} The timeout in seconds. Default 60
Expand Down Expand Up @@ -140,14 +147,6 @@ export class HTTP extends IonicNativePlugin {
@Cordova()
acceptAllCerts(accept: boolean): Promise<void> { return; }

/**
* Whether or not to validate the domain name in the certificate. This defaults to true.
* @param validate {boolean} Set to true to validate
* @returns {Promise<void>} returns a promise that will resolve on success, and reject on failure
*/
@Cordova()
validateDomainName(validate: boolean): Promise<void> { return; }

/**
* Make a POST request
* @param url {string} The url to send the request to
Expand Down Expand Up @@ -178,6 +177,16 @@ export class HTTP extends IonicNativePlugin {
@Cordova()
put(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }

/**
* Make a PATCH request
* @param url {string} The url to send the request to
* @param body {Object} The body of the request
* @param headers {Object} The headers to set for this request
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@Cordova()
patch(url: string, body: any, headers: any): Promise<HTTPResponse> { return; }

/**
* Make a DELETE request
* @param url {string} The url to send the request to
Expand Down

0 comments on commit d96d3ee

Please sign in to comment.