appcd-request
v3.0.0
Published
HTTP client for the Appc Daemon.
Downloads
95
Readme
appcd-request
Wrapper around request that applies Appc Daemon configuration when making HTTP requests.
Visit https://github.com/appcelerator/appc-daemon for more information.
Report issues to GitHub issues. Official issue tracker in JIRA.
Installation
npm i appcd-request
Usage
Refer to the request package's documentation for information about the supported options.
import request from 'appcd-request';
// `req` is the actual `request` object returned by `request` package
const req = await request({
url: 'http://127.0.0.1:1337'
// additional `request` options
}, (err, res, body) => {
if (err) {
console.error(err);
} else {
console.log(req.statusCode);
console.log(body);
}
});
req.on('data', chunk => {
console.log(`Received ${chunk.length} bytes`);
});
Environment Variables
APPCD_NETWORK_CA_FILE
Path to a certificate authority file to use to validate the web server's certificate.
APPCD_NETWORK_PROXY
The proxy server URL to use for the request.
APPCD_NETWORK_STRICT_SSL
By default, SSL validation is not strict. Setting this environment variable to anything other than
"false"
will enable strict SSL validation.
Legal
This project is open source under the Apache Public License v2 and is developed by
Axway, Inc and the community. Please read the LICENSE
file included
in this distribution for more information.