Browse Source

Merge pull request #33 from ncnlinh/patch-1

Fix "PUT" requests being sent as "POST"
wkh237 8 years ago
parent
commit
0b7e9f3b20
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

@@ -129,9 +129,9 @@ public class RNFetchBlobReq implements Runnable{
129 129
                     break;
130 130
                 case "put" :
131 131
                     if(this.type == null || this.type.equalsIgnoreCase("octet"))
132
-                        req.post(ctx, url, entity, "application/octet-stream", handler);
132
+                        req.put(ctx, url, entity, "application/octet-stream", handler);
133 133
                     else
134
-                        req.post(ctx, url, entity, "multipart/form-data", handler);
134
+                        req.put(ctx, url, entity, "multipart/form-data", handler);
135 135
                     break;
136 136
                 case "delete" :
137 137
                     req.delete(url, handler);