From d96d3eef07f702b3b64fd7fc8214c7801c8ca998 Mon Sep 17 00:00:00 2001 From: Sefa Ilkimen Date: Thu, 9 Nov 2017 21:13:36 +0000 Subject: [PATCH] feat(http): add support for new methods (#2054) * feat(http): add patch request support (#2052) * feat(http): add "disableRedirect" support (#2022) * fix(http): remove obsolete "validateDomainName" function (#2053) --- src/@ionic-native/plugins/http/index.ts | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/@ionic-native/plugins/http/index.ts b/src/@ionic-native/plugins/http/index.ts index 73d97c7557..56c84069d2 100644 --- a/src/@ionic-native/plugins/http/index.ts +++ b/src/@ionic-native/plugins/http/index.ts @@ -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 @@ -140,14 +147,6 @@ export class HTTP extends IonicNativePlugin { @Cordova() acceptAllCerts(accept: boolean): Promise { 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} returns a promise that will resolve on success, and reject on failure - */ - @Cordova() - validateDomainName(validate: boolean): Promise { return; } - /** * Make a POST request * @param url {string} The url to send the request to @@ -178,6 +177,16 @@ export class HTTP extends IonicNativePlugin { @Cordova() put(url: string, body: any, headers: any): Promise { 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} returns a promise that resolve on success, and reject on failure + */ + @Cordova() + patch(url: string, body: any, headers: any): Promise { return; } + /** * Make a DELETE request * @param url {string} The url to send the request to