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
* [A drop-in replacement for the [default http module](https://docs.nativescript.org/cookbook/http).](#a-drop-in-replacement-for-the-default-http-modulehttpsdocsnativescriptorgcookbookhttp)
45
-
* [Features](#features)
46
-
* [FAQ](#faq)
47
-
* [Installation](#installation-1)
48
-
* [Examples](#examples)
49
-
* [Hitting an API using `GET` method](#hitting-an-api-using-get-method)
50
-
* [Configuration](#configuration)
51
-
* [Installing your SSL certificate](#installing-your-ssl-certificate)
* [A drop-in replacement for the [default http module](https://docs.nativescript.org/cookbook/http).](#a-drop-in-replacement-for-the-default-http-modulehttpsdocsnativescriptorgcookbookhttp)
45
+
* [Features](#features)
46
+
* [FAQ](#faq)
47
+
* [Installation](#installation-1)
48
+
* [Examples](#examples)
49
+
* [Hitting an API using `GET` method](#hitting-an-api-using-get-method)
50
+
* [Configuration](#configuration)
51
+
* [Installing your SSL certificate](#installing-your-ssl-certificate)
Run the following command from the root of your project:
84
84
@@ -92,12 +92,12 @@ Easily integrate the most reliable native networking libraries with the latest a
92
92
93
93
#### A drop-in replacement for the [default http module](https://docs.nativescript.org/cookbook/http).
94
94
95
-
96
-
[](#features)
97
-
98
-
99
-
[](#features)
100
-
95
+
96
+
[](#features)
97
+
98
+
99
+
[](#features)
100
+
101
101
## Features
102
102
103
103
- Modern TLS & SSL security features
@@ -110,12 +110,12 @@ Easily integrate the most reliable native networking libraries with the latest a
110
110
- Cache
111
111
- Basic Cookie support
112
112
113
-
114
-
[](#faq)
115
-
116
-
117
-
[](#faq)
118
-
113
+
114
+
[](#faq)
115
+
116
+
117
+
[](#faq)
118
+
119
119
## FAQ
120
120
121
121
> What the flip is SSL pinning and all this security mumbo jumbo?
@@ -127,24 +127,24 @@ Easily integrate the most reliable native networking libraries with the latest a
127
127
**No.** This plugin works out of the box without any security configurations needed. Either way you'll still benefit from all the features listed above.
| `cachePolicy?: 'noCache' | 'onlyCache' | 'ignoreCache'` | Set the cache policy to use with that request. This only works with GET requests for now. |
274
274
|`onProgress?: (current: number, total: number) => void`|[IOS only] Set the progress callback. |
275
275
276
-
277
-
[](#webpack--bundling)
278
-
279
-
280
-
[](#webpack--bundling)
281
-
276
+
277
+
[](#webpack--bundling)
278
+
279
+
280
+
[](#webpack--bundling)
281
+
282
282
## Webpack / bundling
283
283
284
284
Since you're probably shipping a certificate with your app (like [our demo does](https://github.com/nativescript-community/https/tree/master/demo/app/assets)),
285
285
make sure it's bundled by Webpack as well. You can do this by [adding the certificate(s) with the `CopyWebpackPlugin`](https://github.com/nativescript-community/https/blob/a5c841c0af7ff6d9994fa23f7fba0df0514c58f1/demo/webpack.config.js#L240).
286
286
287
-
288
-
[](#ios-troubleshooting)
289
-
290
-
291
-
[](#ios-troubleshooting)
292
-
287
+
288
+
[](#ios-troubleshooting)
289
+
290
+
291
+
[](#ios-troubleshooting)
292
+
293
293
## `iOS` Troubleshooting
294
294
295
295
> ### Please educate yourself on iOS's [App Transport Security](https://github.com/codepath/ios_guides/wiki/App-Transport-Security) before starting beef!
@@ -307,24 +307,23 @@ You can bypass this behavior by adding the following to your projects `Info.plis
307
307
308
308
> This plugin **does not** add `NSAllowsArbitraryLoads` to your projects `Info.plist` for you.
309
309
310
-
311
-
[](#android-troubleshooting)
312
-
313
-
314
-
[](#android-troubleshooting)
315
-
310
+
311
+
[](#android-troubleshooting)
312
+
313
+
314
+
[](#android-troubleshooting)
315
+
316
316
## `Android` troubleshooting
317
317
318
-
*If you app crashes with a message that it's doing too much networking on the main thread,
318
+
If you app crashes with a message that it's doing too much networking on the main thread,
319
319
then pass the option `allowLargeResponse` with value `true` to the `request` function.
320
-
* When using `useLegacy` (which is the default) `content.toString()` and `content.toJSON()` might throw `android.os.NetworkOnMainThreadException` if called from the main thread (seems to depend on response headers). Either call those from a background thread or use `content.toStringAsync()` or `content.toJSONAsync()`
321
-
* once you've called `content.[toString,toStringAsync,toJSON,toJSONAsync,...]` the response is closed and will throw `java.lang.IllegalStateException: closed` if called again. So choose the right one and only call once. The reason is that we need to close the response so that you dont have too.
322
-
323
-
[](#thanks)
324
-
325
-
326
-
[](#thanks)
327
320
321
+
322
+
[](#thanks)
323
+
324
+
325
+
[](#thanks)
326
+
328
327
# Thanks
329
328
330
329
| Who | Why |
@@ -340,12 +339,12 @@ then pass the option `allowLargeResponse` with value `true` to the `request` fun
340
339
-[Basic](demo-snippets/vue/Basic.vue)
341
340
- A basic example
342
341
343
-
344
-
[](#demos-and-development)
345
-
346
-
347
-
[](#demos-and-development)
348
-
342
+
343
+
[](#demos-and-development)
344
+
345
+
346
+
[](#demos-and-development)
347
+
349
348
## Demos and Development
350
349
351
350
@@ -385,12 +384,12 @@ Demo setup is a bit special in the sense that if you want to modify/add demos yo
385
384
Instead you work in `demo-snippets/[ng|react|svelte|vue]`
386
385
You can start from the `install.ts` of each flavor to see how to register new demos
387
386
388
-
389
-
[](#contributing)
390
-
391
-
392
-
[](#contributing)
393
-
387
+
388
+
[](#contributing)
389
+
390
+
391
+
[](#contributing)
392
+
394
393
## Contributing
395
394
396
395
### Update repo
@@ -438,18 +437,18 @@ One easy solution is t modify `~/.gitconfig` and add
438
437
pushInsteadOf = https://github.com/
439
438
```
440
439
441
-
442
-
[](#questions)
443
-
444
-
445
-
[](#questions)
446
-
440
+
441
+
[](#questions)
442
+
443
+
444
+
[](#questions)
445
+
447
446
## Questions
448
447
449
448
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).
450
-
451
-
[](#demos-and-development)
452
-
449
+
450
+
[](#demos-and-development)
451
+
453
452
## Demos and Development
454
453
455
454
@@ -489,9 +488,9 @@ Demo setup is a bit special in the sense that if you want to modify/add demos yo
489
488
Instead you work in `demo-snippets/[ng|react|svelte|vue]`
490
489
You can start from the `install.ts` of each flavor to see how to register new demos
491
490
492
-
493
-
[](#contributing)
494
-
491
+
492
+
[](#contributing)
493
+
495
494
## Contributing
496
495
497
496
### Update repo
@@ -538,9 +537,9 @@ One easy solution is t modify `~/.gitconfig` and add
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).
0 commit comments