diff --git a/src/ios/CordovaHttpPlugin.h b/src/ios/CordovaHttpPlugin.h index e87a1de..3b35e17 100644 --- a/src/ios/CordovaHttpPlugin.h +++ b/src/ios/CordovaHttpPlugin.h @@ -6,10 +6,12 @@ - (void)setServerTrustMode:(CDVInvokedUrlCommand*)command; - (void)post:(CDVInvokedUrlCommand*)command; -- (void)get:(CDVInvokedUrlCommand*)command; - (void)put:(CDVInvokedUrlCommand*)command; - (void)patch:(CDVInvokedUrlCommand*)command; +- (void)get:(CDVInvokedUrlCommand*)command; - (void)delete:(CDVInvokedUrlCommand*)command; +- (void)head:(CDVInvokedUrlCommand*)command; +- (void)options:(CDVInvokedUrlCommand*)command; - (void)uploadFiles:(CDVInvokedUrlCommand*)command; - (void)downloadFile:(CDVInvokedUrlCommand*)command; diff --git a/src/ios/CordovaHttpPlugin.m b/src/ios/CordovaHttpPlugin.m index df31126..ac559c6 100644 --- a/src/ios/CordovaHttpPlugin.m +++ b/src/ios/CordovaHttpPlugin.m @@ -302,6 +302,18 @@ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } +- (void)post:(CDVInvokedUrlCommand*)command { + [self executeRequestWithData: command withMethod:@"POST"]; +} + +- (void)put:(CDVInvokedUrlCommand*)command { + [self executeRequestWithData: command withMethod:@"PUT"]; +} + +- (void)patch:(CDVInvokedUrlCommand*)command { + [self executeRequestWithData: command withMethod:@"PATCH"]; +} + - (void)get:(CDVInvokedUrlCommand*)command { [self executeRequestWithoutData: command withMethod:@"GET"]; } @@ -314,16 +326,8 @@ [self executeRequestWithoutData: command withMethod:@"HEAD"]; } -- (void)post:(CDVInvokedUrlCommand*)command { - [self executeRequestWithData: command withMethod:@"POST"]; -} - -- (void)put:(CDVInvokedUrlCommand*)command { - [self executeRequestWithData: command withMethod:@"PUT"]; -} - -- (void)patch:(CDVInvokedUrlCommand*)command { - [self executeRequestWithData: command withMethod:@"PATCH"]; +- (void)options:(CDVInvokedUrlCommand*)command { + [self executeRequestWithoutData: command withMethod:@"OPTIONS"]; } - (void)uploadFiles:(CDVInvokedUrlCommand*)command {