appcd-request

2019-09-12

HTTP client for the Appc Daemon.

appcd-request

Wrapper around requestthat applies Appc Daemon configuration when making HTTP requests.

Visit https://github.com/appcelerator/appc-daemonfor more information.

Report issues to GitHub issues. Official issue tracker in JIRA.

Installation

npm i appcd-request

Usage

Refer to the requestpackage'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 v2and is developed by Axway, Incand the community. Please read the LICENSEfile included in this distribution for more information.

HomePage

https://github.com/appcelerator/appc-daemon

Repository

https://github.com/appcelerator/appc-daemon/tree/master/packages/appcd-request


上一篇:appcd-response
下一篇:appcd-nodejs
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部