Browse Source

Merge pull request #147 from cosmith/android-patch

Add PATCH support for upload on Android
wkh237 8 years ago
parent
commit
74ae0ce84f
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
                 }
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
                 String cType = getHeaderIgnoreCases(mheaders, "Content-Type").toLowerCase();
224
                 String cType = getHeaderIgnoreCases(mheaders, "Content-Type").toLowerCase();
225
 
225
 
226
                 if(rawRequestBodyArray != null) {
226
                 if(rawRequestBodyArray != null) {
281
                     break;
281
                     break;
282
 
282
 
283
                 case WithoutBody:
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
                         builder.method(method, RequestBody.create(null, new byte[0]));
286
                         builder.method(method, RequestBody.create(null, new byte[0]));
287
                     }
287
                     }