Skip to content

Commit e18f9ee

Browse files
committed
implement feat silkimen#155 for iOS
1 parent c7eb60e commit e18f9ee

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/ios/CordovaHttpPlugin.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66

77
- (void)setServerTrustMode:(CDVInvokedUrlCommand*)command;
88
- (void)post:(CDVInvokedUrlCommand*)command;
9-
- (void)get:(CDVInvokedUrlCommand*)command;
109
- (void)put:(CDVInvokedUrlCommand*)command;
1110
- (void)patch:(CDVInvokedUrlCommand*)command;
11+
- (void)get:(CDVInvokedUrlCommand*)command;
1212
- (void)delete:(CDVInvokedUrlCommand*)command;
13+
- (void)head:(CDVInvokedUrlCommand*)command;
14+
- (void)options:(CDVInvokedUrlCommand*)command;
1315
- (void)uploadFiles:(CDVInvokedUrlCommand*)command;
1416
- (void)downloadFile:(CDVInvokedUrlCommand*)command;
1517

src/ios/CordovaHttpPlugin.m

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,18 @@ - (void)setServerTrustMode:(CDVInvokedUrlCommand*)command {
302302
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
303303
}
304304

305+
- (void)post:(CDVInvokedUrlCommand*)command {
306+
[self executeRequestWithData: command withMethod:@"POST"];
307+
}
308+
309+
- (void)put:(CDVInvokedUrlCommand*)command {
310+
[self executeRequestWithData: command withMethod:@"PUT"];
311+
}
312+
313+
- (void)patch:(CDVInvokedUrlCommand*)command {
314+
[self executeRequestWithData: command withMethod:@"PATCH"];
315+
}
316+
305317
- (void)get:(CDVInvokedUrlCommand*)command {
306318
[self executeRequestWithoutData: command withMethod:@"GET"];
307319
}
@@ -314,16 +326,8 @@ - (void)head:(CDVInvokedUrlCommand*)command {
314326
[self executeRequestWithoutData: command withMethod:@"HEAD"];
315327
}
316328

317-
- (void)post:(CDVInvokedUrlCommand*)command {
318-
[self executeRequestWithData: command withMethod:@"POST"];
319-
}
320-
321-
- (void)put:(CDVInvokedUrlCommand*)command {
322-
[self executeRequestWithData: command withMethod:@"PUT"];
323-
}
324-
325-
- (void)patch:(CDVInvokedUrlCommand*)command {
326-
[self executeRequestWithData: command withMethod:@"PATCH"];
329+
- (void)options:(CDVInvokedUrlCommand*)command {
330+
[self executeRequestWithoutData: command withMethod:@"OPTIONS"];
327331
}
328332

329333
- (void)uploadFiles:(CDVInvokedUrlCommand*)command {

0 commit comments

Comments
 (0)