react-native-ssl-pinning
Version:
React-Native Ssl pinning using OkHttp 3 in Android, and AFNetworking on iOS.
34 lines (29 loc) • 813 B
Flow
// @flow
export type Header = {
[headerName: string]: string;
}
export type Cookies = {
[cookieName: string]: string;
}
export type Options = {
body?: string | {},
credentials?: string,
headers?: Header,
method?: 'DELETE' | 'GET' | 'POST' | 'PUT',
sslPinning: {
certs: Array<string>
},
timeoutInterval?: number,
disableAllSecurity?: boolean
}
export type Response = {
bodyString: string,
headers: Header,
status: number,
url: string,
json: () => Promise<{ [key: string]: any}>,
text: () => Promise<string>,
}
declare export function fetch(url: string, options: Options): Promise<Response>;
declare export function removeCookieByName(cookieName: string): Promise<void>
declare export function getCookies(domain: string): Promise<Cookies>