sslfetch
v0.1.8
Published
ssl for fetch api
Readme
sslfetch
SSL fetch for react-native. This project allows to call the APIs natively with a custom base64 string certificate, which means you can protect the server with a self-signed SSL certificate.
Could be more advanced, but let's face it. I have more stuff to do. Wanna help? Sure drop us a DM.
Installation
npm install sslfetch
or
yarn add sslfetchIOS? please do the tipical install
cd ios && pod install && cd ..
Usage
import * as SslFetch from 'sslfetchModule';
// ...
const link = "https://www.example.com"
const options = {
method: 'POST', // or 'POST', 'PUT', etc.
headers: { 'Content-Type': 'application/json', "Authorization": ("Bearer " + token) },
body: body, // If you have a body
base64PFX: certificate, // in base64 string
password: "A custom server authentication token such as JWT or AES or SIV"
};
try {
let a1 = await Sslfetch.makeRequest(link, options)
return a1
} catch (err) {
console.log(err)
}
const result = await SslFetch.makeRequest(url: String, arguments: string[]);Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
