How to use the request.debug function in request

To help you get started, we’ve selected a few request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SelfKeyFoundation / Identity-Wallet / src / common / config.js View on Github external
/* istanbul ignore file */
'use strict';
const path = require('path');
let electron;
if (!process.env.STORYBOOK) {
	const dotenv = require('dotenv');
	dotenv.config();
	electron = require('electron');
}
const { isDevMode, isTestMode, getSetupFilePath, getUserDataPath } = require('./utils/common');
const pkg = require('../../package.json');

const DEBUG_REQUEST = process.env.DEBUG_REQUEST === '1';
if (DEBUG_REQUEST) {
	require('request').debug = true;
}
const CHAIN_ID = process.env.CHAIN_ID_OVERRIDE;
const NODE = process.env.NODE_OVERRIDE;
const PRIMARY_TOKEN = process.env.PRIMARY_TOKEN_OVERRIDE
	? process.env.PRIMARY_TOKEN_OVERRIDE.toUpperCase()
	: null;

// KYCC ENV variables
const KYCC_API_OVERRIDE = process.env.KYCC_API_OVERRIDE;
// Incorporations ENV variables
const INCORPORATIONS_TEMPLATE_OVERRIDE = process.env.INCORPORATIONS_TEMPLATE_OVERRIDE;
const INCORPORATIONS_PRICE_OVERRIDE = process.env.INCORPORATIONS_PRICE_OVERRIDE;
const INCORPORATION_API_URL = process.env.INCORPORATION_API_URL;
const INCORPORATION_TREATIES_URL = process.env.INCORPORATION_TREATIES_URL;
// Bank Accounts ENV variables
const BANKACCOUNTS_TEMPLATE_OVERRIDE = process.env.BANKACCOUNTS_TEMPLATE_OVERRIDE;
github cubehouse / PSNjs / psn_request.js View on Github external
// init library
	if (options)
	{
		/** In-built optional debug log */
		if (options.debug)
		{
			this.OnLog(DebugLog);
		}

		/** Optionally debug the Request lib */
		if (options.requestDebug)
		{
			require('request').debug = true;
		}

		// store email and password
		if (options.email && options.password)
		{
			login_details.email = options.email;
			login_details.password = options.password;
		}

		// optionally read/write to an authfile
		if (options.authfile)
		{
			// register to OnSave
			parent.OnSave(function(data, callback)
			{
				fs.writeFile(options.authfile, data, function(err)
github petermuessig / ui5-ecosystem-showcase / packages / ui5-middleware-cfdestination / lib / cfdestination.js View on Github external
module.exports = function ({resources, options}) {
    request.debug = options.configuration.debug; // pass debug flag on to underlying request lib
    process.env.XS_APP_LOG_LEVEL = options.configuration.debug ? 'DEBUG' : 'ERROR';
    // read in the cf config file
    const xsappConfig = JSON.parse(fs.readFileSync(options.configuration.xsappJson, 'utf8'));

    let regExes = [];
    xsappConfig.routes.forEach(route => {
        // ignore /-redirects (e.g. "^/(.*)"
        // a source declaration such as "^/backend/(.*)$" is needed
        if (route.source.match(/.*\/.*\/.*/)) {
            regExes.push(new RegExp(route.source));
            options.configuration.debug ? log.info(`adding cf-like destination "${route.destination}" proxying reqs to ${route.source}`) : null;
        }
    });

    // req-use app-router with config file to run in "shadow" mode
    process.env.destinations = JSON.stringify(options.configuration.destinations);
github SelfKeyFoundation / Identity-Wallet / src / common / config.js View on Github external
/* istanbul ignore file */
'use strict';
const path = require('path');
const dotenv = require('dotenv');
const electron = require('electron');

const { isDevMode, isTestMode, getSetupFilePath, getUserDataPath } = require('./utils/common');
const pkg = require('../../package.json');

dotenv.config();
const DEBUG_REQUEST = process.env.DEBUG_REQUEST === '1';
if (DEBUG_REQUEST) {
	require('request').debug = true;
}
const CHAIN_ID = process.env.CHAIN_ID_OVERRIDE;
const NODE = process.env.NODE_OVERRIDE;
const PRIMARY_TOKEN = process.env.PRIMARY_TOKEN_OVERRIDE
	? process.env.PRIMARY_TOKEN_OVERRIDE.toUpperCase()
	: null;

const INCORPORATION_KYCC_INSTANCE = process.env.INCORPORATION_KYCC_INSTANCE;
const MATOMO_SITE = process.env.MATOMO_SITE;

let userDataDirectoryPath = '';
let walletsDirectoryPath = '';
if (electron.app) {
	userDataDirectoryPath = electron.app.getPath('userData');
	walletsDirectoryPath = path.resolve(userDataDirectoryPath, 'wallets');
}
github wayneashleyberry / wunderline / lib / get-inbox.js View on Github external
api("/lists", function(err, res, body) {
    if (request.debug) {
      console.log("REQUEST", "response", "body", body);
    }

    if (err || body.error) {
      console.error(JSON.stringify(err || body.error, null, 2));
      process.exit(1);
    }

    var lists = body.filter(function(item) {
      return item.list_type === "inbox";
    });

    var inbox = lists[0];

    cache.inbox = inbox;
github silklabs / silk / docs / examples / FB_Security_Cam / device-bot-client / index.js View on Github external
'use strict';

const log = require('silk-log')('main'),
  Camera = require('silk-camera').default,
  path = require('path'),
  request = require('request'),
  fs = require('fs'),
  urljoin = require('url-join'),
  https = require('https'),
  wifi = require('silk-wifi').default;


require('request').debug = true
let device = require('./device');
device.init();
const config = require('./config');
const fullUploadUrl = config.uploadUrl + '/' + config.id + '/' + config.secret
let uploadBusy = false;

let camera = new Camera();
camera.init()
  .then(() => {
    log.info('camera initialized');
    camera.startRecording();
  }).catch(e => {
    log.info('Error: ' + e);
  });
github garystafford / virtual-vehicles-demo / virtual-vehicle-meanio / packages / custom / vehicles / server / controllers / vehicles.js View on Github external
'use strict';

var request = require('request');
require('request').debug = true;

var host = 'http://localhost:8581/virtual/vehicles';

exports.getVehicles = function (req, res) {

    request(host, function (error, response, body) {
        if (!error && response.statusCode === 200) {
            res.type('application/javascript');
            res.jsonp({
                'vehicles': JSON.parse(body)._embedded.vehicles
            });
            //console.log(body);
        } else {
            console.error(error);
        }
    });
github SqrTT / Bart / spec / debugger-spec.js View on Github external
'use babel';

import request from 'request';
request.debug = true;

import DebuggerConnection from "../lib/DebuggerConnection";



describe('Debugger', () => {
    it('should exists', () => {
        expect(DebuggerConnection).toNotBe(undefined);
    });
    it('should be a function constructor', () => {
        expect(typeof DebuggerConnection).toBe('function');
    });

    it('should check breackpoints', () => {
        const deb = new DebuggerConnection(credentials);
        waitsForPromise(() => deb.init().then(() => {
github gajus / async-request / dist / main.js View on Github external
"use strict";

var _core = require("babel-runtime/core-js")["default"];

var _regeneratorRuntime = require("babel-runtime/regenerator")["default"];

var _this = this;

var Arequest = undefined,
    request = require("request"),
    _ = require("lodash");

request.debug = false;

Arequest = function (defaultOptions) {
    var arequest = undefined;

    Arequest.validateOptions(defaultOptions);

    arequest = function callee$1$0(url, options) {
        return _regeneratorRuntime.async(function callee$1$0$(context$2$0) {
            while (1) switch (context$2$0.prev = context$2$0.next) {
                case 0:
                    return context$2$0.abrupt("return", new _core.Promise(function (resolve) {
                        Arequest.validateOptions(options);

                        options = _.assign({ url: url }, options, defaultOptions);

                        options = Arequest.mapOptions(options);
github gajus / async-request / src / main.js View on Github external
'use strict';

let Arequest,
    request = require('request'),
    _ = require('lodash');

request.debug = false;

Arequest = (defaultOptions) => {
    let arequest;

    Arequest.validateOptions(defaultOptions);

    arequest = async (url, options) => {
        return new Promise((resolve) => {
            Arequest.validateOptions(options);

            options = _.assign({url: url}, options, defaultOptions);

            options = Arequest.mapOptions(options);

            request(options, (error, response) => {
                if (error) {