You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -84,6 +88,7 @@ export class HTTP extends IonicNativePlugin {
84
88
UNSUPPORTED_URL: number;
85
89
NOT_CONNECTED: number;
86
90
POST_PROCESSING_FAILED: number;
91
+
ABORTED: number;
87
92
};
88
93
89
94
/**
@@ -230,6 +235,29 @@ export class HTTP extends IonicNativePlugin {
230
235
return;
231
236
}
232
237
238
+
/**
239
+
* Make a sync POST request
240
+
* @param url {string} The url to send the request to
241
+
* @param body {Object} The body of the request
242
+
* @param headers {Object} The headers to set for this request
243
+
* @param success {function} A callback that is called when the request succeed
244
+
* @param failure {function} A callback that is called when the request failed
245
+
* @returns {string} returns a string that represents the requestId
246
+
*/
247
+
@Cordova({
248
+
methodName: 'post',
249
+
sync: true,
250
+
})
251
+
postSync(
252
+
url: string,
253
+
body: any,
254
+
headers: any,
255
+
success: (result: HTTPResponse)=>void,
256
+
failure: (error: any)=>void
257
+
): string{
258
+
return;
259
+
}
260
+
233
261
/**
234
262
* Make a GET request
235
263
* @param url {string} The url to send the request to
@@ -242,6 +270,29 @@ export class HTTP extends IonicNativePlugin {
242
270
return;
243
271
}
244
272
273
+
/**
274
+
* Make a sync GET request
275
+
* @param url {string} The url to send the request to
276
+
* @param parameters {Object} Parameters to send with the request
277
+
* @param headers {Object} The headers to set for this request
278
+
* @param success {function} A callback that is called when the request succeed
279
+
* @param failure {function} A callback that is called when the request failed
280
+
* @returns {string} returns a string that represents the requestId
281
+
*/
282
+
@Cordova({
283
+
methodName: 'get',
284
+
sync: true,
285
+
})
286
+
getSync(
287
+
url: string,
288
+
parameters: any,
289
+
headers: any,
290
+
success: (result: HTTPResponse)=>void,
291
+
failure: (error: any)=>void
292
+
): string{
293
+
return;
294
+
}
295
+
245
296
/**
246
297
* Make a PUT request
247
298
* @param url {string} The url to send the request to
@@ -254,6 +305,29 @@ export class HTTP extends IonicNativePlugin {
254
305
return;
255
306
}
256
307
308
+
/**
309
+
* Make a sync PUT request
310
+
* @param url {string} The url to send the request to
311
+
* @param body {Object} The body of the request
312
+
* @param headers {Object} The headers to set for this request
313
+
* @param success {function} A callback that is called when the request succeed
314
+
* @param failure {function} A callback that is called when the request failed
315
+
* @returns {string} returns a string that represents the requestId
316
+
*/
317
+
@Cordova({
318
+
methodName: 'put',
319
+
sync: true,
320
+
})
321
+
putSync(
322
+
url: string,
323
+
body: any,
324
+
headers: any,
325
+
success: (result: HTTPResponse)=>void,
326
+
failure: (error: any)=>void
327
+
): string{
328
+
return;
329
+
}
330
+
257
331
/**
258
332
* Make a PATCH request
259
333
* @param url {string} The url to send the request to
@@ -266,6 +340,29 @@ export class HTTP extends IonicNativePlugin {
266
340
return;
267
341
}
268
342
343
+
/**
344
+
* Make a sync PATCH request
345
+
* @param url {string} The url to send the request to
346
+
* @param body {Object} The body of the request
347
+
* @param headers {Object} The headers to set for this request
348
+
* @param success {function} A callback that is called when the request succeed
349
+
* @param failure {function} A callback that is called when the request failed
350
+
* @returns {string} returns a string that represents the requestId
351
+
*/
352
+
@Cordova({
353
+
methodName: 'patch',
354
+
sync: true,
355
+
})
356
+
patchSync(
357
+
url: string,
358
+
body: any,
359
+
headers: any,
360
+
success: (result: HTTPResponse)=>void,
361
+
failure: (error: any)=>void
362
+
): string{
363
+
return;
364
+
}
365
+
269
366
/**
270
367
* Make a DELETE request
271
368
* @param url {string} The url to send the request to
@@ -278,6 +375,29 @@ export class HTTP extends IonicNativePlugin {
278
375
return;
279
376
}
280
377
378
+
/**
379
+
* Make a sync DELETE request
380
+
* @param url {string} The url to send the request to
381
+
* @param parameters {Object} Parameters to send with the request
382
+
* @param headers {Object} The headers to set for this request
383
+
* @param success {function} A callback that is called when the request succeed
384
+
* @param failure {function} A callback that is called when the request failed
385
+
* @returns {string} returns a string that represents the requestId
386
+
*/
387
+
@Cordova({
388
+
methodName: 'delete',
389
+
sync: true,
390
+
})
391
+
deleteSync(
392
+
url: string,
393
+
parameters: any,
394
+
headers: any,
395
+
success: (result: HTTPResponse)=>void,
396
+
failure: (error: any)=>void
397
+
): string{
398
+
return;
399
+
}
400
+
281
401
/**
282
402
* Make a HEAD request
283
403
* @param url {string} The url to send the request to
@@ -290,6 +410,29 @@ export class HTTP extends IonicNativePlugin {
290
410
return;
291
411
}
292
412
413
+
/**
414
+
* Make a sync HEAD request
415
+
* @param url {string} The url to send the request to
416
+
* @param parameters {Object} Parameters to send with the request
417
+
* @param headers {Object} The headers to set for this request
418
+
* @param success {function} A callback that is called when the request succeed
419
+
* @param failure {function} A callback that is called when the request failed
420
+
* @returns {string} returns a string that represents the requestId
421
+
*/
422
+
@Cordova({
423
+
methodName: 'head',
424
+
sync: true,
425
+
})
426
+
headSync(
427
+
url: string,
428
+
parameters: any,
429
+
headers: any,
430
+
success: (result: HTTPResponse)=>void,
431
+
failure: (error: any)=>void
432
+
): string{
433
+
return;
434
+
}
435
+
293
436
/**
294
437
* Make an OPTIONS request
295
438
* @param url {string} The url to send the request to
@@ -302,6 +445,29 @@ export class HTTP extends IonicNativePlugin {
302
445
return;
303
446
}
304
447
448
+
/**
449
+
* Make an sync OPTIONS request
450
+
* @param url {string} The url to send the request to
451
+
* @param parameters {Object} Parameters to send with the request
452
+
* @param headers {Object} The headers to set for this request
453
+
* @param success {function} A callback that is called when the request succeed
454
+
* @param failure {function} A callback that is called when the request failed
455
+
* @returns {string} returns a string that represents the requestId
456
+
*/
457
+
@Cordova({
458
+
methodName: 'options',
459
+
sync: true,
460
+
})
461
+
optionsSync(
462
+
url: string,
463
+
parameters: any,
464
+
headers: any,
465
+
success: (result: HTTPResponse)=>void,
466
+
failure: (error: any)=>void
467
+
): string{
468
+
return;
469
+
}
470
+
305
471
/**
306
472
*
307
473
* @param url {string} The url to send the request to
@@ -316,6 +482,33 @@ export class HTTP extends IonicNativePlugin {
316
482
return;
317
483
}
318
484
485
+
/**
486
+
*
487
+
* @param url {string} The url to send the request to
488
+
* @param body {Object} The body of the request
489
+
* @param headers {Object} The headers to set for this request
490
+
* @param filePath {string} The local path(s) of the file(s) to upload
491
+
* @param name {string} The name(s) of the parameter to pass the file(s) along as
492
+
* @param success {function} A callback that is called when the request succeed
493
+
* @param failure {function} A callback that is called when the request failed
494
+
* @returns {string} returns a string that represents the requestId
495
+
*/
496
+
@Cordova({
497
+
methodName: 'uploadFile',
498
+
sync: true,
499
+
})
500
+
uploadFileSync(
501
+
url: string,
502
+
body: any,
503
+
headers: any,
504
+
filePath: string|string[],
505
+
name: string|string[],
506
+
success: (result: any)=>void,
507
+
failure: (error: any)=>void
508
+
): string{
509
+
return;
510
+
}
511
+
319
512
/**
320
513
*
321
514
* @param url {string} The url to send the request to
@@ -329,6 +522,31 @@ export class HTTP extends IonicNativePlugin {
329
522
return;
330
523
}
331
524
525
+
/**
526
+
*
527
+
* @param url {string} The url to send the request to
528
+
* @param body {Object} The body of the request
529
+
* @param headers {Object} The headers to set for this request
530
+
* @param filePath {string} The path to download the file to, including the file name.
531
+
* @param success {function} A callback that is called when the request succeed
532
+
* @param failure {function} A callback that is called when the request failed
533
+
* @returns {string} returns a string that represents the requestId
534
+
*/
535
+
@Cordova({
536
+
methodName: 'downloadFile',
537
+
sync: true,
538
+
})
539
+
downloadFileSync(
540
+
url: string,
541
+
body: any,
542
+
headers: any,
543
+
filePath: string,
544
+
success: (result: any)=>void,
545
+
failure: (error: any)=>void
546
+
): string{
547
+
return;
548
+
}
549
+
332
550
/**
333
551
*
334
552
* @param url {string} The url to send the request to
@@ -362,4 +580,53 @@ export class HTTP extends IonicNativePlugin {
362
580
): Promise<HTTPResponse>{
363
581
return;
364
582
}
583
+
584
+
/**
585
+
*
586
+
* @param url {string} The url to send the request to
587
+
* @param options {Object} options for individual request
588
+
* @param options.method {string} request method
589
+
* @param options.data {Object} payload to be send to the server (only applicable on post, put or patch methods)
590
+
* @param options.params {Object} query params to be appended to the URL (only applicable on get, head, delete, upload or download methods)
591
+
* @param options.serializer {string} data serializer to be used (only applicable on post, put or patch methods), defaults to global serializer value, see setDataSerializer for supported values
592
+
* @param options.timeout {number} timeout value for the request in seconds, defaults to global timeout value
593
+
* @param options.headers {Object} headers object (key value pair), will be merged with global values
594
+
* @param options.filePath {string} file path(s) to be used during upload and download see uploadFile and downloadFile for detailed information
595
+
* @param options.name {string} name(s) to be used during upload see uploadFile for detailed information
596
+
* @param options.responseType {string} response type, defaults to text
597
+
* @param success {function} A callback that is called when the request succeed
598
+
* @param failure {function} A callback that is called when the request failed
599
+
*
600
+
* @returns {string} returns a string that represents the requestId
0 commit comments