forked from nativescript-community/https
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
319 lines (314 loc) · 49.7 KB
/
index.html
File metadata and controls
319 lines (314 loc) · 49.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Nativescript plugin for https requests</title><meta name="description" content="Documentation for Nativescript plugin for https requests"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"><a href="https://docs.nativescript.org">Nativescript Doc</a></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">Nativescript plugin for https requests</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>Nativescript plugin for https requests</h2></div><div class="tsd-panel tsd-typography"><!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️--><!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
DO NOT EDIT THIS READEME DIRECTLY! Edit "bluesprint.md" instead.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<h1 align="center">@nativescript-community/https</h1>
<p align="center">
<a href="https://npmcharts.com/compare/@nativescript-community/https?minimal=true"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@nativescript-community/https.svg" height="20"/></a>
<a href="https://www.npmjs.com/package/@nativescript-community/https"><img alt="NPM Version" src="https://img.shields.io/npm/v/@nativescript-community/https.svg" height="20"/></a>
</p>
<p align="center">
<b>Nativescript plugin for https requests</b></br>
<sub><sub>
</p>
<br />
<p><a href="#md:table-of-contents"></a></p>
<p><a href="#md:table-of-contents"></a></p>
<a id="md:table-of-contents" class="tsd-anchor"></a><h2><a href="#md:table-of-contents">Table of Contents</a></h2><pre><code><span class="hl-0">* [</span><span class="hl-1">Installation</span><span class="hl-0">](#</span><span class="hl-1">installation</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-2">A</span><span class="hl-0"> </span><span class="hl-1">drop</span><span class="hl-0">-</span><span class="hl-3">in</span><span class="hl-0"> </span><span class="hl-1">replacement</span><span class="hl-0"> </span><span class="hl-1">for</span><span class="hl-0"> </span><span class="hl-1">the</span><span class="hl-0"> [</span><span class="hl-1">default</span><span class="hl-0"> </span><span class="hl-1">http</span><span class="hl-0"> </span><span class="hl-4">module</span><span class="hl-0">](</span><span class="hl-1">https</span><span class="hl-0">:</span><span class="hl-5">//docs.nativescript.org/cookbook/http).](#a-drop-in-replacement-for-the-default-http-modulehttpsdocsnativescriptorgcookbookhttp)</span><br/><span class="hl-0">* [</span><span class="hl-1">Features</span><span class="hl-0">](#</span><span class="hl-1">features</span><span class="hl-0">)</span><br/><span class="hl-0">* [</span><span class="hl-2">FAQ</span><span class="hl-0">](#</span><span class="hl-1">faq</span><span class="hl-0">)</span><br/><span class="hl-0">* [</span><span class="hl-1">Installation</span><span class="hl-0">](#</span><span class="hl-1">installation</span><span class="hl-0">-</span><span class="hl-6">1</span><span class="hl-0">)</span><br/><span class="hl-0">* [</span><span class="hl-1">Examples</span><span class="hl-0">](#</span><span class="hl-1">examples</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-1">Hitting</span><span class="hl-0"> </span><span class="hl-1">an</span><span class="hl-0"> </span><span class="hl-2">API</span><span class="hl-0"> </span><span class="hl-1">using</span><span class="hl-0"> </span><span class="hl-7">`GET`</span><span class="hl-0"> </span><span class="hl-1">method</span><span class="hl-0">](#</span><span class="hl-1">hitting</span><span class="hl-0">-</span><span class="hl-1">an</span><span class="hl-0">-</span><span class="hl-1">api</span><span class="hl-0">-</span><span class="hl-1">using</span><span class="hl-0">-</span><span class="hl-1">get</span><span class="hl-0">-</span><span class="hl-1">method</span><span class="hl-0">)</span><br/><span class="hl-0">* [</span><span class="hl-1">Configuration</span><span class="hl-0">](#</span><span class="hl-1">configuration</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-1">Installing</span><span class="hl-0"> </span><span class="hl-1">your</span><span class="hl-0"> </span><span class="hl-2">SSL</span><span class="hl-0"> </span><span class="hl-1">certificate</span><span class="hl-0">](#</span><span class="hl-1">installing</span><span class="hl-0">-</span><span class="hl-1">your</span><span class="hl-0">-</span><span class="hl-1">ssl</span><span class="hl-0">-</span><span class="hl-1">certificate</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-1">Enabling</span><span class="hl-0"> </span><span class="hl-2">SSL</span><span class="hl-0"> </span><span class="hl-1">pinning</span><span class="hl-0">](#</span><span class="hl-1">enabling</span><span class="hl-0">-</span><span class="hl-1">ssl</span><span class="hl-0">-</span><span class="hl-1">pinning</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-1">Disabling</span><span class="hl-0"> </span><span class="hl-2">SSL</span><span class="hl-0"> </span><span class="hl-1">pinning</span><span class="hl-0">](#</span><span class="hl-1">disabling</span><span class="hl-0">-</span><span class="hl-1">ssl</span><span class="hl-0">-</span><span class="hl-1">pinning</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-1">useLegacy</span><span class="hl-0">](#</span><span class="hl-1">uselegacy</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-1">Cookie</span><span class="hl-0">](#</span><span class="hl-1">cookie</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-1">Enabling</span><span class="hl-0"> </span><span class="hl-1">Cache</span><span class="hl-0">](#</span><span class="hl-1">enabling</span><span class="hl-0">-</span><span class="hl-1">cache</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-1">Multipart</span><span class="hl-0"> </span><span class="hl-1">form</span><span class="hl-0"> </span><span class="hl-1">data</span><span class="hl-0">](#</span><span class="hl-1">multipart</span><span class="hl-0">-</span><span class="hl-1">form</span><span class="hl-0">-</span><span class="hl-1">data</span><span class="hl-0">)</span><br/><span class="hl-0"> * [</span><span class="hl-1">Options</span><span class="hl-0">](#</span><span class="hl-1">options</span><span class="hl-0">)</span><br/><span class="hl-0">* [</span><span class="hl-1">Webpack</span><span class="hl-0"> / </span><span class="hl-1">bundling</span><span class="hl-0">](#</span><span class="hl-1">webpack</span><span class="hl-0">--</span><span class="hl-1">bundling</span><span class="hl-0">)</span><br/><span class="hl-0">* [</span><span class="hl-7">`iOS`</span><span class="hl-0"> </span><span class="hl-1">Troubleshooting</span><span class="hl-0">](#</span><span class="hl-1">ios</span><span class="hl-0">-</span><span class="hl-1">troubleshooting</span><span class="hl-0">)</span><br/><span class="hl-0">* [</span><span class="hl-7">`Android`</span><span class="hl-0"> </span><span class="hl-1">troubleshooting</span><span class="hl-0">](#</span><span class="hl-1">android</span><span class="hl-0">-</span><span class="hl-1">troubleshooting</span><span class="hl-0">)</span>
</code><button>Copy</button></pre>
<ul>
<li><a href="#md:thanks">Thanks</a>
* <a href="#md:examples-1">Examples:</a><ul>
<li><a href="#md:demos-and-development">Demos and Development</a><ul>
<li><a href="#md:repo-setup">Repo Setup</a></li>
<li><a href="#md:build">Build</a></li>
<li><a href="#md:demos">Demos</a></li>
</ul>
</li>
<li><a href="#md:contributing">Contributing</a><ul>
<li><a href="#md:update-repo-">Update repo </a></li>
<li><a href="#md:update-readme-">Update readme </a></li>
<li><a href="#md:update-doc-">Update doc </a></li>
<li><a href="#md:publish">Publish</a></li>
<li><a href="#md:modifying-submodules">modifying submodules</a></li>
</ul>
</li>
<li><a href="#md:questions">Questions</a></li>
</ul>
</li>
</ul>
<p><a href="#md:installation"></a></p>
<p><a href="#md:installation"></a></p>
<a id="md:installation" class="tsd-anchor"></a><h2><a href="#md:installation">Installation</a></h2><p>Run the following command from the root of your project:</p>
<p><code>ns plugin add @nativescript-community/https</code></p>
<p>Easily integrate the most reliable native networking libraries with the latest and greatest HTTPS security features.</p>
<blockquote>
<p>Android: version 4.x using okhttp 4.x changing minSDKVersion to 21! If lower needed stick to 3.x</p>
</blockquote>
<blockquote>
<p>Plugin version 2.0.0 bumps <code>AFNetworking</code> on iOS to <a href="https://github.com/AFNetworking/AFNetworking/releases/tag/4.0.0">4.0.0</a> which no longer relies on <code>UIWebView</code>. Make sure to run <code>pod repo update</code> to get the latest <code>AFNetworking</code> pod on your development machine.</p>
</blockquote>
<a id="md:a-drop-in-replacement-for-the-default-http-module" class="tsd-anchor"></a><h4><a href="#md:a-drop-in-replacement-for-the-default-http-module">A drop-in replacement for the <a href="https://docs.nativescript.org/cookbook/http">default http module</a>.</a></h4><p><a href="#md:features"></a></p>
<p><a href="#md:features"></a></p>
<a id="md:features" class="tsd-anchor"></a><h2><a href="#md:features">Features</a></h2><ul>
<li>Modern TLS & SSL security features</li>
<li>Shared connection pooling reduces request latency</li>
<li>Silently recovers from common connection problems</li>
<li>Everything runs on a native background thread</li>
<li>Transparent GZIP</li>
<li>HTTP/2 support</li>
<li>Multiform part</li>
<li>Cache</li>
<li>Basic Cookie support</li>
</ul>
<p><a href="#md:faq"></a></p>
<p><a href="#md:faq"></a></p>
<a id="md:faq" class="tsd-anchor"></a><h2><a href="#md:faq">FAQ</a></h2><blockquote>
<p>What the flip is SSL pinning and all this security mumbo jumbo?</p>
</blockquote>
<p><a href="https://infinum.co/the-capsized-eight/how-to-make-your-ios-apps-more-secure-with-ssl-pinning">How to make your apps more secure with SSL pinning</a>.</p>
<blockquote>
<p>Do I have to use SSL pinning?</p>
</blockquote>
<p><strong>No.</strong> This plugin works out of the box without any security configurations needed. Either way you'll still benefit from all the features listed above.</p>
<p><a href="#md:installation"></a></p>
<p><a href="#md:installation"></a></p>
<a id="md:installation-1" class="tsd-anchor"></a><h2><a href="#md:installation-1">Installation</a></h2><pre><code class="language-bash"><span class="hl-8">tns</span><span class="hl-0"> </span><span class="hl-7">plugin</span><span class="hl-0"> </span><span class="hl-7">add</span><span class="hl-0"> </span><span class="hl-7">@nativescript-community/https</span>
</code><button>Copy</button></pre>
<p><a href="#md:examples"></a></p>
<p><a href="#md:examples"></a></p>
<a id="md:examples" class="tsd-anchor"></a><h2><a href="#md:examples">Examples</a></h2><a id="md:hitting-an-api-using-get-method" class="tsd-anchor"></a><h3><a href="#md:hitting-an-api-using-get-method">Hitting an API using <code>GET</code> method</a></h3><pre><code class="language-typescript"><span class="hl-9">import</span><span class="hl-0"> </span><span class="hl-3">*</span><span class="hl-0"> </span><span class="hl-9">as</span><span class="hl-0"> </span><span class="hl-1">Https</span><span class="hl-0"> </span><span class="hl-9">from</span><span class="hl-0"> </span><span class="hl-7">'@nativescript-community/https'</span><span class="hl-0">;</span><br/><span class="hl-1">Https</span><span class="hl-0">.</span><span class="hl-8">request</span><span class="hl-0">({</span><br/><span class="hl-0"> </span><span class="hl-1">url:</span><span class="hl-0"> </span><span class="hl-7">'https://httpbin.org/get'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-1">method:</span><span class="hl-0"> </span><span class="hl-7">'GET'</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-1">timeout:</span><span class="hl-0"> </span><span class="hl-6">30</span><span class="hl-0">, </span><span class="hl-5">// seconds (default 10)</span><br/><span class="hl-0">})</span><br/><span class="hl-0"> .</span><span class="hl-8">then</span><span class="hl-0">(</span><span class="hl-3">function</span><span class="hl-0"> (</span><span class="hl-1">response</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-1">console</span><span class="hl-0">.</span><span class="hl-8">log</span><span class="hl-0">(</span><span class="hl-7">'Https.request response'</span><span class="hl-0">, </span><span class="hl-1">response</span><span class="hl-0">);</span><br/><span class="hl-0"> })</span><br/><span class="hl-0"> .</span><span class="hl-8">catch</span><span class="hl-0">(</span><span class="hl-3">function</span><span class="hl-0"> (</span><span class="hl-1">error</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-1">console</span><span class="hl-0">.</span><span class="hl-8">error</span><span class="hl-0">(</span><span class="hl-7">'Https.request error'</span><span class="hl-0">, </span><span class="hl-1">error</span><span class="hl-0">);</span><br/><span class="hl-0"> });</span>
</code><button>Copy</button></pre>
<p><a href="#md:configuration"></a></p>
<p><a href="#md:configuration"></a></p>
<a id="md:configuration" class="tsd-anchor"></a><h2><a href="#md:configuration">Configuration</a></h2><a id="md:installing-your-ssl-certificate" class="tsd-anchor"></a><h3><a href="#md:installing-your-ssl-certificate">Installing your SSL certificate</a></h3><p>Create a folder called <code>assets</code> in your projects <code>app</code> folder like so <code><project>/app/assets</code>. Using chrome, go to the URL where the SSL certificate resides. View the details then drag and drop the certificate image into the <code>assets</code> folder.</p>
<p><img src="http://i.imgur.com/hn4duT3.gif" alt="Installing your SSL certificate"></p>
<a id="md:enabling-ssl-pinning" class="tsd-anchor"></a><h4><a href="#md:enabling-ssl-pinning">Enabling SSL pinning</a></h4><pre><code class="language-typescript"><span class="hl-9">import</span><span class="hl-0"> { </span><span class="hl-1">knownFolders</span><span class="hl-0"> } </span><span class="hl-9">from</span><span class="hl-0"> </span><span class="hl-7">'file-system'</span><span class="hl-0">;</span><br/><span class="hl-9">import</span><span class="hl-0"> </span><span class="hl-3">*</span><span class="hl-0"> </span><span class="hl-9">as</span><span class="hl-0"> </span><span class="hl-1">Https</span><span class="hl-0"> </span><span class="hl-9">from</span><span class="hl-0"> </span><span class="hl-7">'@nativescript-community/https'</span><span class="hl-0">;</span><br/><span class="hl-3">let</span><span class="hl-0"> </span><span class="hl-1">dir</span><span class="hl-0"> = </span><span class="hl-1">knownFolders</span><span class="hl-0">.</span><span class="hl-8">currentApp</span><span class="hl-0">().</span><span class="hl-8">getFolder</span><span class="hl-0">(</span><span class="hl-7">'assets'</span><span class="hl-0">);</span><br/><span class="hl-3">let</span><span class="hl-0"> </span><span class="hl-1">certificate</span><span class="hl-0"> = </span><span class="hl-1">dir</span><span class="hl-0">.</span><span class="hl-8">getFile</span><span class="hl-0">(</span><span class="hl-7">'httpbin.org.cer'</span><span class="hl-0">).</span><span class="hl-1">path</span><span class="hl-0">;</span><br/><span class="hl-1">Https</span><span class="hl-0">.</span><span class="hl-8">enableSSLPinning</span><span class="hl-0">({ </span><span class="hl-1">host:</span><span class="hl-0"> </span><span class="hl-7">'httpbin.org'</span><span class="hl-0">, </span><span class="hl-1">certificate</span><span class="hl-0"> });</span>
</code><button>Copy</button></pre>
<p>Once you've enabled SSL pinning you <strong>CAN NOT</strong> re-enable with a different <code>host</code> or <code>certificate</code> file.</p>
<a id="md:disabling-ssl-pinning" class="tsd-anchor"></a><h4><a href="#md:disabling-ssl-pinning">Disabling SSL pinning</a></h4><pre><code class="language-typescript"><span class="hl-9">import</span><span class="hl-0"> </span><span class="hl-3">*</span><span class="hl-0"> </span><span class="hl-9">as</span><span class="hl-0"> </span><span class="hl-1">Https</span><span class="hl-0"> </span><span class="hl-9">from</span><span class="hl-0"> </span><span class="hl-7">'@nativescript-community/https'</span><span class="hl-0">;</span><br/><span class="hl-1">Https</span><span class="hl-0">.</span><span class="hl-8">disableSSLPinning</span><span class="hl-0">();</span>
</code><button>Copy</button></pre>
<p>All requests after calling this method will no longer utilize SSL pinning until it is re-enabled once again.</p>
<a id="md:uselegacy" class="tsd-anchor"></a><h3><a href="#md:uselegacy">useLegacy</a></h3><p>There is a new option called <code>useLegacy</code>. You can set of every request options.
When using that option the request will behave more like {N} http module.</p>
<ul>
<li>the <code>content</code> returned by a request is not the resulting string but an object. It follows <a href="https://docs.nativescript.org/api-reference/interfaces/_http_.httpcontent">HTTPContent</a> format for the most part. You can call <code>toJSON</code> or <code>toFile</code>. The only difference is that <code>toFile</code> returns a <code>Promise<File></code> which means that it is async and run in a background thread!</li>
<li>an error return a <code>content</code> too allowing you to read its content.</li>
</ul>
<a id="md:cookie" class="tsd-anchor"></a><h3><a href="#md:cookie">Cookie</a></h3><p>By default basic Cookie support is enabled to work like in {N} <code>http</code> module.
In the future more options will be added</p>
<a id="md:enabling-cache" class="tsd-anchor"></a><h3><a href="#md:enabling-cache">Enabling Cache</a></h3><pre><code class="language-typescript"><span class="hl-9">import</span><span class="hl-0"> { </span><span class="hl-1">knownFolders</span><span class="hl-0">, </span><span class="hl-1">path</span><span class="hl-0"> } </span><span class="hl-9">from</span><span class="hl-0"> </span><span class="hl-7">'@nativescript/core/file-system'</span><span class="hl-0">;</span><br/><span class="hl-9">import</span><span class="hl-0"> </span><span class="hl-3">*</span><span class="hl-0"> </span><span class="hl-9">as</span><span class="hl-0"> </span><span class="hl-1">Https</span><span class="hl-0"> </span><span class="hl-9">from</span><span class="hl-0"> </span><span class="hl-7">'@nativescript-community/https'</span><span class="hl-0">;</span><br/><span class="hl-1">Https</span><span class="hl-0">.</span><span class="hl-8">setCache</span><span class="hl-0">({</span><br/><span class="hl-0"> </span><span class="hl-1">diskLocation:</span><span class="hl-0"> </span><span class="hl-1">path</span><span class="hl-0">.</span><span class="hl-8">join</span><span class="hl-0">(</span><span class="hl-1">knownFolders</span><span class="hl-0">.</span><span class="hl-8">documents</span><span class="hl-0">().</span><span class="hl-1">path</span><span class="hl-0">, </span><span class="hl-7">'httpcache'</span><span class="hl-0">),</span><br/><span class="hl-0"> </span><span class="hl-1">diskSize:</span><span class="hl-0"> </span><span class="hl-6">10</span><span class="hl-0"> * </span><span class="hl-6">1024</span><span class="hl-0"> * </span><span class="hl-6">1024</span><span class="hl-0">, </span><span class="hl-5">// 10 MiB</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-5">/// later on when calling your request you can use the cachePolicy option</span>
</code><button>Copy</button></pre>
<a id="md:multipart-form-data" class="tsd-anchor"></a><h3><a href="#md:multipart-form-data">Multipart form data</a></h3><p>If you set the <code>Content-Type</code> header to <code>"multipart/form-data"</code> the request body will be evaluated as a multipart form data. Each body parameter is expected to be in this format:</p>
<pre><code class="language-typescript"><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-10">data</span><span class="hl-0">: </span><span class="hl-1">any</span><br/><span class="hl-0"> </span><span class="hl-10">parameterName</span><span class="hl-0">: </span><span class="hl-1">string</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-1">fileName</span><span class="hl-0">?: </span><span class="hl-1">string</span><br/><span class="hl-0"> </span><span class="hl-1">contentType</span><span class="hl-0">?: </span><span class="hl-1">string</span><br/><span class="hl-0">}</span><br/>
</code><button>Copy</button></pre>
<p>if <code>fileName</code> and <code>contentType</code> are set then data is expected to be either a <code>NSData</code> on iOS or a <code>native.Array<number></code> on Android.</p>
<a id="md:options" class="tsd-anchor"></a><h3><a href="#md:options">Options</a></h3><pre><code class="language-typescript"><span class="hl-9">export</span><span class="hl-0"> </span><span class="hl-3">interface</span><span class="hl-0"> </span><span class="hl-4">HttpsSSLPinningOptions</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-1">host</span><span class="hl-0">: </span><span class="hl-4">string</span><span class="hl-0">;</span><br/><span class="hl-0"> </span><span class="hl-1">certificate</span><span class="hl-0">: </span><span class="hl-4">string</span><span class="hl-0">;</span><br/><span class="hl-0"> </span><span class="hl-1">allowInvalidCertificates</span><span class="hl-0">?: </span><span class="hl-4">boolean</span><span class="hl-0">;</span><br/><span class="hl-0"> </span><span class="hl-1">validatesDomainName</span><span class="hl-0">?: </span><span class="hl-4">boolean</span><span class="hl-0">;</span><br/><span class="hl-0"> </span><span class="hl-1">commonName</span><span class="hl-0">?: </span><span class="hl-4">string</span><span class="hl-0">;</span><br/><span class="hl-0">}</span><br/><span class="hl-9">import</span><span class="hl-0"> { </span><span class="hl-1">HttpRequestOptions</span><span class="hl-0"> } </span><span class="hl-9">from</span><span class="hl-0"> </span><span class="hl-7">'tns-core-modules/http'</span><span class="hl-0">;</span><br/><span class="hl-9">export</span><span class="hl-0"> </span><span class="hl-3">interface</span><span class="hl-0"> </span><span class="hl-4">HttpsRequestOptions</span><span class="hl-0"> </span><span class="hl-3">extends</span><span class="hl-0"> </span><span class="hl-4">HTTPOptions</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-1">useLegacy</span><span class="hl-0">?: </span><span class="hl-4">boolean</span><span class="hl-0">;</span><br/><span class="hl-0"> </span><span class="hl-1">cachePolicy</span><span class="hl-0">?: </span><span class="hl-7">'noCache'</span><span class="hl-0"> | </span><span class="hl-7">'onlyCache'</span><span class="hl-0"> | </span><span class="hl-7">'ignoreCache'</span><span class="hl-0">;</span><br/><span class="hl-0"> </span><span class="hl-8">onProgress</span><span class="hl-0">?: (</span><span class="hl-1">current</span><span class="hl-0">: </span><span class="hl-4">number</span><span class="hl-0">, </span><span class="hl-1">total</span><span class="hl-0">: </span><span class="hl-4">number</span><span class="hl-0">) </span><span class="hl-3">=></span><span class="hl-0"> </span><span class="hl-4">void</span><span class="hl-0">;</span><br/><span class="hl-0">}</span>
</code><button>Copy</button></pre>
<table>
<thead>
<tr>
<th>SSLPinning Option</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td><code>host: string</code></td>
<td>This must be the request domain name eg <code>sales.company.org</code>.</td>
</tr>
<tr>
<td><code>commonName?: string</code></td>
<td>Default: options.host, set if certificate CN is different from the host eg <code>*.company.org</code> (Android specific)</td>
</tr>
<tr>
<td><code>certificate: string</code></td>
<td>The uri path to your <code>.cer</code> certificate file.</td>
</tr>
<tr>
<td><code>allowInvalidCertificates?: boolean</code></td>
<td>Default: <code>false</code>. This should <strong>always</strong> be <code>false</code> if you are using SSL pinning. Set this to <code>true</code> if you're using a self-signed certificate.</td>
</tr>
<tr>
<td><code>validatesDomainName?: boolean</code></td>
<td>Default: <code>true</code>. Determines if the domain name should be validated with your pinned certificate.</td>
</tr>
</tbody></table>
<table>
<thead>
<tr>
<th>Requests Option</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td><code>useLegacy?: boolean</code></td>
<td>Default: <code>false</code>. [IOS only] set to true in order to get the response data (when status >= 300)in the <code>content</code> directly instead of <code>response.body.content</code>.</td>
</tr>
<tr>
<td>`cachePolicy?: 'noCache'</td>
<td>'onlyCache'</td>
</tr>
<tr>
<td><code>onProgress?: (current: number, total: number) => void</code></td>
<td>[IOS only] Set the progress callback.</td>
</tr>
</tbody></table>
<p><a href="#md:webpack--bundling"></a></p>
<p><a href="#md:webpack--bundling"></a></p>
<a id="md:webpack--bundling" class="tsd-anchor"></a><h2><a href="#md:webpack--bundling">Webpack / bundling</a></h2><p>Since you're probably shipping a certificate with your app (like <a href="https://github.com/nativescript-community/https/tree/master/demo/app/assets">our demo does</a>),
make sure it's bundled by Webpack as well. You can do this by <a href="https://github.com/nativescript-community/https/blob/a5c841c0af7ff6d9994fa23f7fba0df0514c58f1/demo/webpack.config.js#L240">adding the certificate(s) with the <code>CopyWebpackPlugin</code></a>.</p>
<p><a href="#md:ios-troubleshooting"></a></p>
<p><a href="#md:ios-troubleshooting"></a></p>
<a id="md:ios-troubleshooting" class="tsd-anchor"></a><h2><a href="#md:ios-troubleshooting"><code>iOS</code> Troubleshooting</a></h2><blockquote>
<a id="md:please-educate-yourself-on-ios39s-app-transport-security-before-starting-beef" class="tsd-anchor"></a><h3><a href="#md:please-educate-yourself-on-ios39s-app-transport-security-before-starting-beef">Please educate yourself on iOS's <a href="https://github.com/codepath/ios_guides/wiki/App-Transport-Security">App Transport Security</a> before starting beef!</a></h3></blockquote>
<p>If you try and hit an <code>https</code> route without adding it to App Transport Security's whitelist it will not work!
You can bypass this behavior by adding the following to your projects <code>Info.plist</code>:</p>
<pre><code class="language-xml"><span class="hl-11"><</span><span class="hl-12">key</span><span class="hl-11">></span><span class="hl-0">NSAppTransportSecurity</span><span class="hl-11"></</span><span class="hl-12">key</span><span class="hl-11">></span><br/><span class="hl-11"><</span><span class="hl-12">dict</span><span class="hl-11">></span><br/><span class="hl-0"> </span><span class="hl-11"><</span><span class="hl-12">key</span><span class="hl-11">></span><span class="hl-0">NSAllowsArbitraryLoads</span><span class="hl-11"></</span><span class="hl-12">key</span><span class="hl-11">></span><br/><span class="hl-0"> </span><span class="hl-11"><</span><span class="hl-12">true</span><span class="hl-11">/></span><br/><span class="hl-11"></</span><span class="hl-12">dict</span><span class="hl-11">></span>
</code><button>Copy</button></pre>
<blockquote>
<p>This plugin <strong>does not</strong> add <code>NSAllowsArbitraryLoads</code> to your projects <code>Info.plist</code> for you.</p>
</blockquote>
<p><a href="#md:android-troubleshooting"></a></p>
<p><a href="#md:android-troubleshooting"></a></p>
<a id="md:android-troubleshooting" class="tsd-anchor"></a><h2><a href="#md:android-troubleshooting"><code>Android</code> troubleshooting</a></h2><p>If you app crashes with a message that it's doing too much networking on the main thread,
then pass the option <code>allowLargeResponse</code> with value <code>true</code> to the <code>request</code> function.</p>
<p><a href="#md:thanks"></a></p>
<p><a href="#md:thanks"></a></p>
<a id="md:thanks" class="tsd-anchor"></a><h1><a href="#md:thanks">Thanks</a></h1><table>
<thead>
<tr>
<th>Who</th>
<th>Why</th>
</tr>
</thead>
<tbody><tr>
<td><a href="https://github.com/roblav96">Robert Laverty</a></td>
<td>For creating and maintaining this plugin for a long time</td>
</tr>
<tr>
<td><a href="https://github.com/gethuman">Jeff Whelple</a></td>
<td>For contributing</td>
</tr>
<tr>
<td><a href="https://github.com/EddyVerbruggen">Eddy Verbruggen</a></td>
<td>For maintaining this before it got transferred</td>
</tr>
<tr>
<td><a href="https://github.com/AFNetworking">AFNetworking</a></td>
<td><a href="https://github.com/AFNetworking/AFNetworking">AFNetworking</a> A delightful networking framework for iOS, OS X, watchOS, and tvOS.</td>
</tr>
<tr>
<td><a href="http://square.github.io/">Square</a></td>
<td><a href="https://github.com/square/okhttp">okhttp</a> An HTTP+HTTP/2 client for Android and Java applications.</td>
</tr>
</tbody></table>
<a id="md:examples-1" class="tsd-anchor"></a><h3><a href="#md:examples-1">Examples:</a></h3><ul>
<li><a href="demo-snippets/vue/Basic.vue">Basic</a><ul>
<li>A basic example</li>
</ul>
</li>
</ul>
<p><a href="#md:demos-and-development"></a></p>
<p><a href="#md:demos-and-development"></a></p>
<a id="md:demos-and-development" class="tsd-anchor"></a><h2><a href="#md:demos-and-development">Demos and Development</a></h2><a id="md:repo-setup" class="tsd-anchor"></a><h3><a href="#md:repo-setup">Repo Setup</a></h3><p>The repo uses submodules. If you did not clone with <code> --recursive</code> then you need to call</p>
<pre><code><span class="hl-1">git</span><span class="hl-0"> </span><span class="hl-1">submodule</span><span class="hl-0"> </span><span class="hl-1">update</span><span class="hl-0"> --</span><span class="hl-1">init</span>
</code><button>Copy</button></pre>
<p>The package manager used to install and link dependencies must be <code>pnpm</code> or <code>yarn</code>. <code>npm</code> wont work.</p>
<p>To develop and test:
if you use <code>yarn</code> then run <code>yarn</code>
if you use <code>pnpm</code> then run <code>pnpm i</code></p>
<p><strong>Interactive Menu:</strong></p>
<p>To start the interactive menu, run <code>npm start</code> (or <code>yarn start</code> or <code>pnpm start</code>). This will list all of the commonly used scripts.</p>
<a id="md:build" class="tsd-anchor"></a><h3><a href="#md:build">Build</a></h3><pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">build.all</span>
</code><button>Copy</button></pre>
<p>WARNING: it seems <code>yarn build.all</code> wont always work (not finding binaries in <code>node_modules/.bin</code>) which is why the doc explicitly uses <code>npm run</code></p>
<a id="md:demos" class="tsd-anchor"></a><h3><a href="#md:demos">Demos</a></h3><pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">demo.[ng</span><span class="hl-0">|</span><span class="hl-8">react</span><span class="hl-0">|</span><span class="hl-8">svelte</span><span class="hl-0">|</span><span class="hl-8">vue].[ios</span><span class="hl-0">|</span><span class="hl-8">android]</span><br/><br/><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">demo.svelte.ios</span><span class="hl-0"> </span><span class="hl-5"># Example</span>
</code><button>Copy</button></pre>
<p>Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in <code>demo-[ng|react|svelte|vue]</code>
Instead you work in <code>demo-snippets/[ng|react|svelte|vue]</code>
You can start from the <code>install.ts</code> of each flavor to see how to register new demos </p>
<p><a href="#md:contributing"></a></p>
<p><a href="#md:contributing"></a></p>
<a id="md:contributing" class="tsd-anchor"></a><h2><a href="#md:contributing">Contributing</a></h2><a id="md:update-repo" class="tsd-anchor"></a><h3><a href="#md:update-repo">Update repo</a></h3><p>You can update the repo files quite easily</p>
<p>First update the submodules</p>
<pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">update</span>
</code><button>Copy</button></pre>
<p>Then commit the changes
Then update common files</p>
<pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">sync</span>
</code><button>Copy</button></pre>
<p>Then you can run <code>yarn|pnpm</code>, commit changed files if any</p>
<a id="md:update-readme" class="tsd-anchor"></a><h3><a href="#md:update-readme">Update readme</a></h3><pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">readme</span>
</code><button>Copy</button></pre>
<a id="md:update-doc" class="tsd-anchor"></a><h3><a href="#md:update-doc">Update doc</a></h3><pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">doc</span>
</code><button>Copy</button></pre>
<a id="md:publish" class="tsd-anchor"></a><h3><a href="#md:publish">Publish</a></h3><p>The publishing is completely handled by <code>lerna</code> (you can add <code>-- --bump major</code> to force a major release)
Simply run </p>
<pre><code class="language-shell"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">publish</span>
</code><button>Copy</button></pre>
<a id="md:modifying-submodules" class="tsd-anchor"></a><h3><a href="#md:modifying-submodules">modifying submodules</a></h3><p>The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
One easy solution is t modify <code>~/.gitconfig</code> and add</p>
<pre><code><span class="hl-0">[</span><span class="hl-1">url</span><span class="hl-0"> </span><span class="hl-7">"ssh://[email protected]/"</span><span class="hl-0">]</span><br/><span class="hl-0"> </span><span class="hl-1">pushInsteadOf</span><span class="hl-0"> = </span><span class="hl-10">https</span><span class="hl-0">:</span><span class="hl-5">//github.com/</span>
</code><button>Copy</button></pre>
<p><a href="#md:questions"></a></p>
<p><a href="#md:questions"></a></p>
<a id="md:questions" class="tsd-anchor"></a><h2><a href="#md:questions">Questions</a></h2><p>If you have any questions/issues/comments please feel free to create an issue or start a conversation in the <a href="https://nativescript.org/discord">NativeScript Community Discord</a>.</p>
<p><a href="#md:demos-and-development"></a></p>
<a id="md:demos-and-development-1" class="tsd-anchor"></a><h2><a href="#md:demos-and-development-1">Demos and Development</a></h2><a id="md:repo-setup-1" class="tsd-anchor"></a><h3><a href="#md:repo-setup-1">Repo Setup</a></h3><p>The repo uses submodules. If you did not clone with <code> --recursive</code> then you need to call</p>
<pre><code><span class="hl-1">git</span><span class="hl-0"> </span><span class="hl-1">submodule</span><span class="hl-0"> </span><span class="hl-1">update</span><span class="hl-0"> --</span><span class="hl-1">init</span>
</code><button>Copy</button></pre>
<p>The package manager used to install and link dependencies must be <code>pnpm</code> or <code>yarn</code>. <code>npm</code> wont work.</p>
<p>To develop and test:
if you use <code>yarn</code> then run <code>yarn</code>
if you use <code>pnpm</code> then run <code>pnpm i</code></p>
<p><strong>Interactive Menu:</strong></p>
<p>To start the interactive menu, run <code>npm start</code> (or <code>yarn start</code> or <code>pnpm start</code>). This will list all of the commonly used scripts.</p>
<a id="md:build-1" class="tsd-anchor"></a><h3><a href="#md:build-1">Build</a></h3><pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">build.all</span>
</code><button>Copy</button></pre>
<p>WARNING: it seems <code>yarn build.all</code> wont always work (not finding binaries in <code>node_modules/.bin</code>) which is why the doc explicitly uses <code>npm run</code></p>
<a id="md:demos-1" class="tsd-anchor"></a><h3><a href="#md:demos-1">Demos</a></h3><pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">demo.[ng</span><span class="hl-0">|</span><span class="hl-8">react</span><span class="hl-0">|</span><span class="hl-8">svelte</span><span class="hl-0">|</span><span class="hl-8">vue].[ios</span><span class="hl-0">|</span><span class="hl-8">android]</span><br/><br/><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">demo.svelte.ios</span><span class="hl-0"> </span><span class="hl-5"># Example</span>
</code><button>Copy</button></pre>
<p>Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in <code>demo-[ng|react|svelte|vue]</code>
Instead you work in <code>demo-snippets/[ng|react|svelte|vue]</code>
You can start from the <code>install.ts</code> of each flavor to see how to register new demos </p>
<p><a href="#md:contributing"></a></p>
<a id="md:contributing-1" class="tsd-anchor"></a><h2><a href="#md:contributing-1">Contributing</a></h2><a id="md:update-repo-1" class="tsd-anchor"></a><h3><a href="#md:update-repo-1">Update repo</a></h3><p>You can update the repo files quite easily</p>
<p>First update the submodules</p>
<pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">update</span>
</code><button>Copy</button></pre>
<p>Then commit the changes
Then update common files</p>
<pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">sync</span>
</code><button>Copy</button></pre>
<p>Then you can run <code>yarn|pnpm</code>, commit changed files if any</p>
<a id="md:update-readme-1" class="tsd-anchor"></a><h3><a href="#md:update-readme-1">Update readme</a></h3><pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">readme</span>
</code><button>Copy</button></pre>
<a id="md:update-doc-1" class="tsd-anchor"></a><h3><a href="#md:update-doc-1">Update doc</a></h3><pre><code class="language-bash"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">doc</span>
</code><button>Copy</button></pre>
<a id="md:publish-1" class="tsd-anchor"></a><h3><a href="#md:publish-1">Publish</a></h3><p>The publishing is completely handled by <code>lerna</code> (you can add <code>-- --bump major</code> to force a major release)
Simply run </p>
<pre><code class="language-shell"><span class="hl-8">npm</span><span class="hl-0"> </span><span class="hl-7">run</span><span class="hl-0"> </span><span class="hl-7">publish</span>
</code><button>Copy</button></pre>
<a id="md:modifying-submodules-1" class="tsd-anchor"></a><h3><a href="#md:modifying-submodules-1">modifying submodules</a></h3><p>The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
One easy solution is t modify <code>~/.gitconfig</code> and add</p>
<pre><code><span class="hl-0">[</span><span class="hl-1">url</span><span class="hl-0"> </span><span class="hl-7">"ssh://[email protected]/"</span><span class="hl-0">]</span><br/><span class="hl-0"> </span><span class="hl-1">pushInsteadOf</span><span class="hl-0"> = </span><span class="hl-10">https</span><span class="hl-0">:</span><span class="hl-5">//github.com/</span>
</code><button>Copy</button></pre>
<p><a href="#md:questions"></a></p>
<a id="md:questions-1" class="tsd-anchor"></a><h2><a href="#md:questions-1">Questions</a></h2><p>If you have any questions/issues/comments please feel free to create an issue or start a conversation in the <a href="https://nativescript.org/discord">NativeScript Community Discord</a>.</p>
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><ul><li><a href="#md:table-of-contents"><span>Table of <wbr/>Contents</span></a></li><li><a href="#md:installation"><span>Installation</span></a></li><li><ul><li><ul><li><a href="#md:a-drop-in-replacement-for-the-default-http-module"><span>A drop-<wbr/>in replacement for the default http module.</span></a></li></ul></li></ul></li><li><a href="#md:features"><span>Features</span></a></li><li><a href="#md:faq"><span>FAQ</span></a></li><li><a href="#md:installation-1"><span>Installation</span></a></li><li><a href="#md:examples"><span>Examples</span></a></li><li><ul><li><a href="#md:hitting-an-api-using-get-method"><span>Hitting an API using GET method</span></a></li></ul></li><li><a href="#md:configuration"><span>Configuration</span></a></li><li><ul><li><a href="#md:installing-your-ssl-certificate"><span>Installing your SSL certificate</span></a></li><li><ul><li><a href="#md:enabling-ssl-pinning"><span>Enabling SSL pinning</span></a></li><li><a href="#md:disabling-ssl-pinning"><span>Disabling SSL pinning</span></a></li></ul></li><li><a href="#md:uselegacy"><span>use<wbr/>Legacy</span></a></li><li><a href="#md:cookie"><span>Cookie</span></a></li><li><a href="#md:enabling-cache"><span>Enabling <wbr/>Cache</span></a></li><li><a href="#md:multipart-form-data"><span>Multipart form data</span></a></li><li><a href="#md:options"><span>Options</span></a></li></ul></li><li><a href="#md:webpack--bundling"><span>Webpack / bundling</span></a></li><li><a href="#md:ios-troubleshooting"><span>iOS <wbr/>Troubleshooting</span></a></li><li><ul><li><a href="#md:please-educate-yourself-on-ios39s-app-transport-security-before-starting-beef"><span>Please educate yourself on iOS's <wbr/>App <wbr/>Transport <wbr/>Security before starting beef!</span></a></li></ul></li><li><a href="#md:android-troubleshooting"><span>Android troubleshooting</span></a></li></ul><a href="#md:thanks"><span>Thanks</span></a><ul><li><ul><li><a href="#md:examples-1"><span>Examples:</span></a></li></ul></li><li><a href="#md:demos-and-development"><span>Demos and <wbr/>Development</span></a></li><li><ul><li><a href="#md:repo-setup"><span>Repo <wbr/>Setup</span></a></li><li><a href="#md:build"><span>Build</span></a></li><li><a href="#md:demos"><span>Demos</span></a></li></ul></li><li><a href="#md:contributing"><span>Contributing</span></a></li><li><ul><li><a href="#md:update-repo"><span>Update repo</span></a></li><li><a href="#md:update-readme"><span>Update readme</span></a></li><li><a href="#md:update-doc"><span>Update doc</span></a></li><li><a href="#md:publish"><span>Publish</span></a></li><li><a href="#md:modifying-submodules"><span>modifying submodules</span></a></li></ul></li><li><a href="#md:questions"><span>Questions</span></a></li><li><a href="#md:demos-and-development-1"><span>Demos and <wbr/>Development</span></a></li><li><ul><li><a href="#md:repo-setup-1"><span>Repo <wbr/>Setup</span></a></li><li><a href="#md:build-1"><span>Build</span></a></li><li><a href="#md:demos-1"><span>Demos</span></a></li></ul></li><li><a href="#md:contributing-1"><span>Contributing</span></a></li><li><ul><li><a href="#md:update-repo-1"><span>Update repo</span></a></li><li><a href="#md:update-readme-1"><span>Update readme</span></a></li><li><a href="#md:update-doc-1"><span>Update doc</span></a></li><li><a href="#md:publish-1"><span>Publish</span></a></li><li><a href="#md:modifying-submodules-1"><span>modifying submodules</span></a></li></ul></li><li><a href="#md:questions-1"><span>Questions</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>Nativescript plugin for https requests</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>