Browse Source

Add PATCH support for upload on Android

Corentin Smith 8 years ago
parent
commit
5ea29019a2
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 2
- 2
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java View File

@@ -220,7 +220,7 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
220 220
                 }
221 221
             }
222 222
 
223
-            if(method.equalsIgnoreCase("post") || method.equalsIgnoreCase("put")) {
223
+            if(method.equalsIgnoreCase("post") || method.equalsIgnoreCase("put") || method.equalsIgnoreCase("patch")) {
224 224
                 String cType = getHeaderIgnoreCases(mheaders, "Content-Type").toLowerCase();
225 225
 
226 226
                 if(rawRequestBodyArray != null) {
@@ -281,7 +281,7 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
281 281
                     break;
282 282
 
283 283
                 case WithoutBody:
284
-                    if(method.equalsIgnoreCase("POST") || method.equalsIgnoreCase("PUT"))
284
+                    if(method.equalsIgnoreCase("post") || method.equalsIgnoreCase("put") || method.equalsIgnoreCase("patch"))
285 285
                     {
286 286
                         builder.method(method, RequestBody.create(null, new byte[0]));
287 287
                     }