Pārlūkot izejas kodu

Add PATCH support for upload on Android

Corentin Smith 8 gadus atpakaļ
vecāks
revīzija
5ea29019a2

+ 2
- 2
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java Parādīt failu

@@ -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
                     }