|
@@ -160,18 +160,10 @@ public class RNFetchBlob extends ReactContextBaseJavaModule {
|
160
|
160
|
RNFetchBlobConfig config = new RNFetchBlobConfig(options);
|
161
|
161
|
|
162
|
162
|
try {
|
163
|
|
- Uri uri = Uri.parse(url);
|
164
|
163
|
AsyncHttpClient req = new AsyncHttpClient();
|
165
|
164
|
|
166
|
|
- // set params
|
167
|
|
- RequestParams params = new RequestParams();
|
168
|
165
|
AbstractHttpEntity entity = null;
|
169
|
166
|
|
170
|
|
- // set params
|
171
|
|
- for (String paramName : uri.getQueryParameterNames()) {
|
172
|
|
- params.put(paramName, uri.getQueryParameter(paramName));
|
173
|
|
- }
|
174
|
|
-
|
175
|
167
|
// set headers
|
176
|
168
|
ReadableMapKeySetIterator it = headers.keySetIterator();
|
177
|
169
|
while (it.hasNextKey()) {
|
|
@@ -212,7 +204,7 @@ public class RNFetchBlob extends ReactContextBaseJavaModule {
|
212
|
204
|
// send request
|
213
|
205
|
switch(method.toLowerCase()) {
|
214
|
206
|
case "get" :
|
215
|
|
- req.get(url, params, handler);
|
|
207
|
+ req.get(url, handler);
|
216
|
208
|
break;
|
217
|
209
|
case "post" :
|
218
|
210
|
req.post(this.getReactApplicationContext(), url, entity, "octet-stream", handler);
|
|
@@ -221,7 +213,7 @@ public class RNFetchBlob extends ReactContextBaseJavaModule {
|
221
|
213
|
req.put(this.getReactApplicationContext(), url, entity, "octet-stream",handler);
|
222
|
214
|
break;
|
223
|
215
|
case "delete" :
|
224
|
|
- req.delete(url, params, handler);
|
|
216
|
+ req.delete(url, handler);
|
225
|
217
|
break;
|
226
|
218
|
}
|
227
|
219
|
} catch(Exception error) {
|
|
@@ -235,16 +227,10 @@ public class RNFetchBlob extends ReactContextBaseJavaModule {
|
235
|
227
|
|
236
|
228
|
RNFetchBlobConfig config = new RNFetchBlobConfig(options);
|
237
|
229
|
try {
|
238
|
|
- Uri uri = Uri.parse(url);
|
|
230
|
+
|
239
|
231
|
AsyncHttpClient req = new AsyncHttpClient();
|
240
|
232
|
|
241
|
|
- // set params
|
242
|
|
- RequestParams params = new RequestParams();
|
243
|
233
|
HttpEntity entity = null;
|
244
|
|
- // set params
|
245
|
|
- for (String paramName : uri.getQueryParameterNames()) {
|
246
|
|
- params.put(paramName, uri.getQueryParameter(paramName));
|
247
|
|
- }
|
248
|
234
|
|
249
|
235
|
// set headers
|
250
|
236
|
if(headers != null) {
|
|
@@ -307,7 +293,7 @@ public class RNFetchBlob extends ReactContextBaseJavaModule {
|
307
|
293
|
// send request
|
308
|
294
|
switch(method.toLowerCase()) {
|
309
|
295
|
case "get" :
|
310
|
|
- req.get(url, params, handler);
|
|
296
|
+ req.get(url, handler);
|
311
|
297
|
break;
|
312
|
298
|
case "post" :
|
313
|
299
|
req.post(this.getReactApplicationContext(), url, entity, "multipart/form-data; charset=utf8", handler);
|
|
@@ -316,7 +302,7 @@ public class RNFetchBlob extends ReactContextBaseJavaModule {
|
316
|
302
|
req.put(this.getReactApplicationContext(), url, entity, "multipart/form-data",handler);
|
317
|
303
|
break;
|
318
|
304
|
case "delete" :
|
319
|
|
- req.delete(url, params, handler);
|
|
305
|
+ req.delete(url, handler);
|
320
|
306
|
break;
|
321
|
307
|
}
|
322
|
308
|
} catch(Exception error) {
|