1.0.1 • Published 2 years ago
node-safe-proxy v1.0.1
Safe-proxy api usage
Installation
npm install node-safe-proxy --save
Usage
const SafeProxy = require("node-safe-proxy")({apiKey: apiKey})
const response = SafeProxy("https://unsafe.example.com")
The response returned is from the node-fetch
libray.
console.log(response.ok);
console.log(response.status);
console.log(response.statusText);
console.log(response.headers.raw());
console.log(response.headers.get('content-type'));
Advance options
Safe proxy uses the node-fetch
under the hood. All arguments passed to node-safe-proxy
are passed through to node-fetch
.
Refer to the node-fetch
documents formore information
POST example
const SafeProxy = require("node-safe-proxy")({apiKey: apiKey})
const response = SafeProxy("https://unsafe.example.com", {method: 'POST', body: blob})