forked from nativescript-community/https
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttps.common.ts
More file actions
36 lines (30 loc) · 910 Bytes
/
https.common.ts
File metadata and controls
36 lines (30 loc) · 910 Bytes
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
import { Headers } from 'tns-core-modules/http'
export interface HttpsSSLPinningOptions {
host: string
certificate: string
allowInvalidCertificates?: boolean
validatesDomainName?: boolean
}
export interface HttpsRequestObject {
[key: string]: string | number
}
export interface HttpsRequestOptions {
url: string
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD'
headers?: Headers
params?: HttpsRequestObject
body?: HttpsRequestObject,
/**
* On Android large responses may crash the app (fi. https://httpbin.org/bytes/10000).
* By setting this to true we allow large responses on the main thread (which this plugin currently does).
* Note that once set to true, this policy remains active until the app is killed.
*/
allowLargeResponse?: boolean;
}
export interface HttpsResponse {
headers?: Headers
statusCode?: number
content?: any
reason?: string
reject?: boolean
}