Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 节点js请求的授权问题_Node.js_Rest_Api_Oauth_Authorization - Fatal编程技术网

Node.js 节点js请求的授权问题

Node.js 节点js请求的授权问题,node.js,rest,api,oauth,authorization,Node.js,Rest,Api,Oauth,Authorization,我很难向ally/tradeking报价流发出经过身份验证的请求 我正在使用NodeJS发出请求。我尝试了几种方法来提出请求,但是为了解决这个问题,我将使用他们的示例,使用e。我想做的是console.log(数据),我希望。相反,我得到了一份未经授权的401。有谁能告诉我一个更好地解决这个问题的方向,或者提供一个更正?以下是我的代码和服务器响应: ///代码/// var OAuth = require('oauth').OAuth; var credentials = { consu

我很难向ally/tradeking报价流发出经过身份验证的请求

我正在使用NodeJS发出请求。我尝试了几种方法来提出请求,但是为了解决这个问题,我将使用他们的示例,使用e。我想做的是console.log(数据),我希望。相反,我得到了一份未经授权的401。有谁能告诉我一个更好地解决这个问题的方向,或者提供一个更正?以下是我的代码和服务器响应:

///代码///

var OAuth = require('oauth').OAuth;
var credentials = {
    consumer_key: "xxxxxxxxxxx",
    consumer_secret: "xxxxxxxxxxx",
    access_token: "xxxxxxxxxxx",
    access_secret: "xxxxxxxxxxx"
};
var oa = new OAuth(null, null, credentials.consumer_key, credentials.consumer_secret, "1.0", null, "HMAC-SHA1");
var request = oa.get("https://stream.tradeking.com/v1/market/quotes?symbols=AAPL", 
credentials.access_token, 
credentials.access_secret);
request.on('response', function (response) {
    response.setEncoding('utf8');
        console.log(response.statusCode)
        console.log(response)
});
request.end();

///回应///

401

IncomingMessage{
_可读状态:
可读状态{
objectMode:false,
高水印:16384,
buffer:BufferList{head:null,tail:null,length:0},
长度:0,
管道:null,
管道:0,
流:null,
结束:错,
提交:错误,
阅读:错,
是的,
答案:错,
错误:错误,
可读性听力:错误,
resumeScheduled:false,
defaultEncoding:'utf8',
拉诺:错,
时间:0,,
雷丁摩尔:没错,
解码器:
字符串解码器{
编码:“utf8”,
fillLast:[函数:utf8FillLast],
最后需要:0,
最后总数:0,
lastChar:},
编码:'utf8'},
可读性:对,
域:空,
_事件:{end:[函数:responseOnEnd]},
_事件提示:1,
_maxListeners:未定义,
插座:
特尔索克特{
_建议:
{pipe:null,
secureContext:[对象],
isServer:false,
requestCert:对,
对,对,
会话:未定义,
NPN协议:未定义,
阿尔卑斯山:未定义,
requestOCSP:undefined},
_是的,,
_securePending:false,
_新闻:假,
_对,,
_返回:null,
服务器名:null,
NP协议:错误,
阿尔卑斯山本:错,
授权:对,
authorizationError:null,
加密:对,
_活动:
{关闭:[对象],
完:[对象],
完成:[函数:onSocketFinish],
_socketEnd:[函数:onSocketEnd],
安全:[功能],
free:[函数:onFree],
agentRemove:[功能:onRemove],
排水管:[功能:ondrain],
错误:[函数:socketErrorListener],
数据:[函数:socketonda]},
_活动日期:10,,
连接:错,
_haderro:false,
_处理:
TLSWrap{
字节:1369,
_外部流:{},
fd:-1,
_父:[对象],
_parentWrap:未定义,
_secureContext:[对象],
阅读:没错,
业主:[通告],
onread:[函数:onread],
writeQueueSize:1,
onhandshakestart:[函数],
onhandshakedone:[函数],
ONOCSP响应:[函数],
onerror:[函数]},
_父项:null,
_主持人:“stream.tradeking.com”,
_可读状态:
可读状态{
objectMode:false,
高水印:16384,
缓冲区:[对象],
长度:0,
管道:null,
管道:0,
是的,
结束:错,
提交:错误,
阅读:错,
同步:假,
对,,
错误:错误,
可读性听力:错误,
resumeScheduled:false,
defaultEncoding:'utf8',
拉诺:错,
时间:0,,
阅读更多:错误,
解码器:空,
编码:null},
可读性:对,
域:空,
_maxListeners:未定义,
_可写状态:
可写状态{
objectMode:false,
高水印:16384,
李安:错,
结尾:错,
结束:错,
完成:假,
解码字符串:false,
defaultEncoding:'utf8',
长度:0,
写作:错,
软木塞:0,
同步:假,
缓冲处理:false,
onwrite:[函数],
writeb:null,
writelen:0,
bufferedRequest:null,
lastBufferedRequest:null,
待定CB:0,
预完成:false,
错误:错误,
bufferedRequestCount:0,
corkedRequestsFree:[对象]},
可写:对,
AllowAllOpen:错误,
销毁:错误,
_字节:539,
_sockname:null,
_pendingData:null,
_彭丁编码:'',
服务器:未定义,
_服务器:空,
ssl:
TLSWrap{
字节:1369,
_外部流:{},
fd:-1,
_父:[对象],
_parentWrap:未定义,
_secureContext:[对象],
阅读:没错,
业主:[通告],
onread:[函数:onread],
writeQueueSize:1,
onhandshakestart:[函数],
onhandshakedone:[函数],
ONOCSP响应:[函数],
onerror:[函数]},
_requestCert:对,
_对,对,
解析器:
HTTPParser{
“0”:[函数:parserOnHeaders],
“1”:[函数:parserOnHeadersComplete],
“2”:[函数:parserOnBody],
“3”:[函数:parserOnMessageComplete],
“4”:null,
_标题:[],
_url:“”,
_错误:,
插座:[圆形],
传入:[循环],
传出:[对象],
maxHeaderPairs:2000,
onIncoming:[函数:parserOnIncomingClient]},
_httpMessage:
客户端请求{
域:空,
_事件:[对象],
_事件提示:2,
_maxListeners:未定义,
输出:[],
输出编码:[],
outputCallbacks:[],
输出大小:0,
可写:对,
_最后:是的,
升级:错,
错误:错误,
应该保持生命:错,
useChunkedEncodingByDefault:false,
发送日期:false,
_removedHeader:[对象],
_contentLength:0,
_哈斯博迪:是的,
_预告片:'',
完成:对,
_海德森:是的,
插座:[圆形],
连接:[循环],
_标题:“GET/v1/market/quotes?symbols=AAPL HTTP/1.1\r\n授权:OAuth OAuth_consumer_key=“xxxxxxxxxxxx”,OAuth_nonce=“O0HLNA9VVVHVI3KxCDIU23A4 QJQXJIWGI”,OAuth_签名方法=“HMAC-SHA1”,OAuth_时间戳=“1511206636”,OAuth_令牌=“xxxxxxxxxxxxxxxxxxxxxxxx”,OAuth_版本=“1.0”,OAuth_签名=“xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”\r\nHost:stream.tradeking
.com\r\n接受:*/*\r\n连接:关闭\r\n用户代理:节点身份验证\r\n内容长度:0\r\n内容类型:应用程序/x-www-form-url
已编码\r\n\r\n',
_标题:[对象],
_头部名称:[对象],
_onPendingData:null,
代理:[对象],
socketPath:未定义,
超时:未定义,
方法:“GET”,
路径:'/v1/market/quotes?symbols=AAPL',
_结束:错,
解析器:[对象],
res:[循环]},
读:[函数],
_是的},
连接:
特尔索克特{
_建议:
{pipe:null,
secureContext:[对象],
isServer:false,
requestCert:对,
对,对,
会话:未定义,
NPN协议:未定义,
阿尔卑斯山:未定义,
requestOCSP:undefined},
_是的,,
_securePending:false,
_新闻:假,
_对,,
_返回:null,
服务器名:null,
NP协议:错误,
IncomingMessage {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: null,
ended: false,
endEmitted: false,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: true,
decoder:
StringDecoder {
encoding: 'utf8',
fillLast: [Function: utf8FillLast],
lastNeed: 0,
lastTotal: 0,
lastChar: <Buffer 00 00 00 00> },
encoding: 'utf8' },
readable: true,
domain: null,
_events: { end: [Function: responseOnEnd] },
_eventsCount: 1,
_maxListeners: undefined,
socket:
TLSSocket {
_tlsOptions:
{ pipe: null,
secureContext: [Object],
isServer: false,
requestCert: true,
rejectUnauthorized: true,
session: undefined,
NPNProtocols: undefined,
ALPNProtocols: undefined,
requestOCSP: undefined },
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: null,
npnProtocol: false,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events:
{ close: [Object],
end: [Object],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
secure: [Function],
free: [Function: onFree],
agentRemove: [Function: onRemove],
drain: [Function: ondrain],
error: [Function: socketErrorListener],
data: [Function: socketOnData] },
_eventsCount: 10,
connecting: false,
_hadError: false,
_handle:
TLSWrap {
bytesRead: 1369,
_externalStream: {},
fd: -1,
_parent: [Object],
_parentWrap: undefined,
_secureContext: [Object],
reading: true,
owner: [Circular],
onread: [Function: onread],
writeQueueSize: 1,
onhandshakestart: [Function],
onhandshakedone: [Function],
onocspresponse: [Function],
onerror: [Function] },
_parent: null,
_host: 'stream.tradeking.com',
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [Object],
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: false,
endEmitted: false,
reading: false,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain: null,
_maxListeners: undefined,
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
needDrain: false,
ending: false,
ended: false,
finished: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree: [Object] },
writable: true,
allowHalfOpen: false,
destroyed: false,
_bytesDispatched: 539,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl:
TLSWrap {
bytesRead: 1369,
_externalStream: {},
fd: -1,
_parent: [Object],
_parentWrap: undefined,
_secureContext: [Object],
reading: true,
owner: [Circular],
onread: [Function: onread],
writeQueueSize: 1,
onhandshakestart: [Function],
onhandshakedone: [Function],
onocspresponse: [Function],
onerror: [Function] },
_requestCert: true,
_rejectUnauthorized: true,
parser:
HTTPParser {
'0': [Function: parserOnHeaders],
'1': [Function: parserOnHeadersComplete],
'2': [Function: parserOnBody],
'3': [Function: parserOnMessageComplete],
'4': null,
_headers: [],
_url: '',
_consumed: false,
socket: [Circular],
incoming: [Circular],
outgoing: [Object],
maxHeaderPairs: 2000,
onIncoming: [Function: parserOnIncomingClient] },
_httpMessage:
ClientRequest {
domain: null,
_events: [Object],
_eventsCount: 2,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
upgrading: false,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedHeader: [Object],
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [Circular],
connection: [Circular],
_header: 'GET /v1/market/quotes?symbols=AAPL HTTP/1.1\r\nAuthorization: OAuth oauth_consumer_key="xxxxxxxxxxxxxxxxxx",oauth_nonce="O0hLnA9vVHvI3KxCDiU23A4QjQxjiWGI",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx ",oauth_version="1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "\r\nHost: stream.tradeking
.com\r\nAccept: */*\r\nConnection: close\r\nUser-Agent: Node authentication\r\nContent-length: 0\r\nContent-Type: application/x-www-form-url
encoded\r\n\r\n',
_headers: [Object],
_headerNames: [Object],
_onPendingData: null,
agent: [Object],
socketPath: undefined,
timeout: undefined,
method: 'GET',
path: '/v1/market/quotes?symbols=AAPL',
_ended: false,
parser: [Object],
res: [Circular] },
read: [Function],
_consuming: true },
connection:
TLSSocket {
_tlsOptions:
{ pipe: null,
secureContext: [Object],
isServer: false,
requestCert: true,
rejectUnauthorized: true,
session: undefined,
NPNProtocols: undefined,
ALPNProtocols: undefined,
requestOCSP: undefined },
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: null,
npnProtocol: false,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events:
{ close: [Object],
end: [Object],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
secure: [Function],
free: [Function: onFree],
agentRemove: [Function: onRemove],
drain: [Function: ondrain],
error: [Function: socketErrorListener],
data: [Function: socketOnData] },
_eventsCount: 10,
connecting: false,
_hadError: false,
_handle:
TLSWrap {
bytesRead: 1369,
_externalStream: {},
fd: -1,
_parent: [Object],
_parentWrap: undefined,
_secureContext: [Object],
reading: true,
owner: [Circular],
onread: [Function: onread],
writeQueueSize: 1,
onhandshakestart: [Function],
onhandshakedone: [Function],
onocspresponse: [Function],
onerror: [Function] },
_parent: null,
_host: 'stream.tradeking.com',
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [Object],
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: false,
endEmitted: false,
reading: false,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain: null,
_maxListeners: undefined,
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
needDrain: false,
ending: false,
ended: false,
finished: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree: [Object] },
writable: true,
allowHalfOpen: false,
destroyed: false,
_bytesDispatched: 539,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl:
TLSWrap {
bytesRead: 1369,
_externalStream: {},
fd: -1,
_parent: [Object],
_parentWrap: undefined,
_secureContext: [Object],
reading: true,
owner: [Circular],
onread: [Function: onread],
writeQueueSize: 1,
onhandshakestart: [Function],
onhandshakedone: [Function],
onocspresponse: [Function],
onerror: [Function] },
_requestCert: true,
_rejectUnauthorized: true,
parser:
HTTPParser {
'0': [Function: parserOnHeaders],
'1': [Function: parserOnHeadersComplete],
'2': [Function: parserOnBody],
'3': [Function: parserOnMessageComplete],
'4': null,
_headers: [],
_url: '',
_consumed: false,
socket: [Circular],
incoming: [Circular],
outgoing: [Object],
maxHeaderPairs: 2000,
onIncoming: [Function: parserOnIncomingClient] },
_httpMessage:
ClientRequest {
domain: null,
_events: [Object],
_eventsCount: 2,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
upgrading: false,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedHeader: [Object],
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [Circular],
connection: [Circular],
_header: 'GET /v1/market/quotes?symbols=AAPL HTTP/1.1\r\nAuthorization: OAuth oauth_consumer_key=" xxxxxxxxxxxxxxxxxx ",oauth_nonce="O0hLnA9vVHvI3KxCDiU23A4QjQxjiWGI",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx ",oauth_version="1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "\r\nHost: stream.tradeking
.com\r\nAccept: */*\r\nConnection: close\r\nUser-Agent: Node authentication\r\nContent-length: 0\r\nContent-Type: application/x-www-form-url
encoded\r\n\r\n',
_headers: [Object],
_headerNames: [Object],
_onPendingData: null,
agent: [Object],
socketPath: undefined,
timeout: undefined,
method: 'GET',
path: '/v1/market/quotes?symbols=AAPL',
_ended: false,
parser: [Object],
res: [Circular] },
read: [Function],
_consuming: true },
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: false,
headers:
{ date: 'Mon, 20 Nov 2017 19:37:36 GMT',
'content-type': 'text/html',
'transfer-encoding': 'chunked',
connection: 'close',
'set-cookie': [ '__cfduid=d85337d9d3c2b7ad190e48a1bb3eb25f41511206655; expires=Tue, 20-Nov-18 19:37:35 GMT; path=/; domain=.tradeking.c
om; HttpOnly' ],
server: 'cloudflare-nginx',
'cf-ray': '3c0ddd5f2f197961-SEA' },
rawHeaders:
[ 'Date',
'Mon, 20 Nov 2017 19:37:36 GMT',
'Content-Type',
'text/html',
'Transfer-Encoding',
'chunked',
'Connection',
'close',
'Set-Cookie',
'__cfduid=d85337d9d3c2b7ad190e48a1bb3eb25f41511206655; expires=Tue, 20-Nov-18 19:37:35 GMT; path=/; domain=.tradeking.com; HttpOnly',
'Server',
'cloudflare-nginx',
'CF-RAY',
'3c0ddd5f2f197961-SEA' ],
trailers: {},
rawTrailers: [],
upgrade: false,
url: '',
method: null,
statusCode: 401,
statusMessage: 'Unauthorized',
client:
TLSSocket {
_tlsOptions:
{ pipe: null,
secureContext: [Object],
isServer: false,
requestCert: true,
rejectUnauthorized: true,
session: undefined,
NPNProtocols: undefined,
ALPNProtocols: undefined,
requestOCSP: undefined },
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: null,
npnProtocol: false,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events:
{ close: [Object],
end: [Object],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
secure: [Function],
free: [Function: onFree],
agentRemove: [Function: onRemove],
drain: [Function: ondrain],
error: [Function: socketErrorListener],
data: [Function: socketOnData] },
_eventsCount: 10,
connecting: false,
_hadError: false,
_handle:
TLSWrap {
bytesRead: 1369,
_externalStream: {},
fd: -1,
_parent: [Object],
_parentWrap: undefined,
_secureContext: [Object],
reading: true,
owner: [Circular],
onread: [Function: onread],
writeQueueSize: 1,
onhandshakestart: [Function],
onhandshakedone: [Function],
onocspresponse: [Function],
onerror: [Function] },
_parent: null,
_host: 'stream.tradeking.com',
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [Object],
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: false,
endEmitted: false,
reading: false,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: false,
resumeScheduled: false,
defaultEncoding: 'utf8',
ranOut: false,
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: true,
domain: null,
_maxListeners: undefined,
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
needDrain: false,
ending: false,
ended: false,
finished: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree: [Object] },
writable: true,
allowHalfOpen: false,
destroyed: false,
_bytesDispatched: 539,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl:
TLSWrap {
bytesRead: 1369,
_externalStream: {},
fd: -1,
_parent: [Object],
_parentWrap: undefined,
_secureContext: [Object],
reading: true,
owner: [Circular],
onread: [Function: onread],
writeQueueSize: 1,
onhandshakestart: [Function],
onhandshakedone: [Function],
onocspresponse: [Function],
onerror: [Function] },
_requestCert: true,
_rejectUnauthorized: true,
parser:
HTTPParser {
'0': [Function: parserOnHeaders],
'1': [Function: parserOnHeadersComplete],
'2': [Function: parserOnBody],
'3': [Function: parserOnMessageComplete],
'4': null,
_headers: [],
_url: '',
_consumed: false,
socket: [Circular],
incoming: [Circular],
outgoing: [Object],
maxHeaderPairs: 2000,
onIncoming: [Function: parserOnIncomingClient] },
_httpMessage:
ClientRequest {
domain: null,
_events: [Object],
_eventsCount: 2,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
upgrading: false,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedHeader: [Object],
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [Circular],
connection: [Circular],
_header: 'GET /v1/market/quotes?symbols=AAPL HTTP/1.1\r\nAuthorization: OAuth oauth_consumer_key=" xxxxxxxxxxxxxxxxxx”,oauth_nonce="O0hLnA9vVHvI3KxCDiU23A4QjQxjiWGI",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx ",oauth_version="1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "\r\nHost: stream.tradeking
.com\r\nAccept: */*\r\nConnection: close\r\nUser-Agent: Node authentication\r\nContent-length: 0\r\nContent-Type: application/x-www-form-url
encoded\r\n\r\n',
_headers: [Object],
_headerNames: [Object],
_onPendingData: null,
agent: [Object],
socketPath: undefined,
timeout: undefined,
method: 'GET',
path: '/v1/market/quotes?symbols=AAPL',
_ended: false,
parser: [Object],
res: [Circular] },
read: [Function],
_consuming: true },
_consuming: false,
_dumped: false,
req:
ClientRequest {
domain: null,
_events:
{ response: [Function],
prefinish: [Function: requestOnPrefinish] },
_eventsCount: 2,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
upgrading: false,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedHeader: { connection: false, 'content-length': false },
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: null,
npnProtocol: false,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 10,
connecting: false,
_hadError: false,
_handle: [Object],
_parent: null,
_host: 'stream.tradeking.com',
_readableState: [Object],
readable: true,
domain: null,
_maxListeners: undefined,
_writableState: [Object],
writable: true,
allowHalfOpen: false,
destroyed: false,
_bytesDispatched: 539,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [Object],
_requestCert: true,
_rejectUnauthorized: true,
parser: [Object],
_httpMessage: [Circular],
read: [Function],
_consuming: true },
connection:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: null,
npnProtocol: false,
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 10,
connecting: false,
_hadError: false,
_handle: [Object],
_parent: null,
_host: 'stream.tradeking.com',
_readableState: [Object],
readable: true,
domain: null,
_maxListeners: undefined,
_writableState: [Object],
writable: true,
allowHalfOpen: false,
destroyed: false,
_bytesDispatched: 539,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [Object],
_requestCert: true,
_rejectUnauthorized: true,
parser: [Object],
_httpMessage: [Circular],
read: [Function],
_consuming: true },
_header: 'GET /v1/market/quotes?symbols=AAPL HTTP/1.1\r\nAuthorization: OAuth oauth_consumer_key=" xxxxxxxxxxxxxxxxxx 
",oauth_nonce=" xxxxxxxxxxxxxxxxxx",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx 
",oauth_version="1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "\r\nHost: stream.tradeking.co
m\r\nAccept: */*\r\nConnection: close\r\nUser-Agent: Node authentication\r\nContent-length: 0\r\nContent-Type: application/x-www-form-urlenc
oded\r\n\r\n',
_headers:
{ authorization: 'OAuth oauth_consumer_key=" xxxxxxxxxxxxxxxxxx ",oauth_nonce="O0hLnA9vVHvI3KxCDiU23A4QjQxjiWG
I",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx ",oauth_version=
"1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "',
host: 'stream.tradeking.com',
accept: '*/*',
connection: 'close',
'user-agent': 'Node authentication',
'content-length': 0,
'content-type': 'application/x-www-form-urlencoded' },
_headerNames:
{ authorization: 'Authorization',
host: 'Host',
accept: 'Accept',
connection: 'Connection',
'user-agent': 'User-Agent',
'content-length': 'Content-length',
'content-type': 'Content-Type' },
_onPendingData: null,
agent:
Agent {
domain: null,
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object],
requests: {},
sockets: [Object],
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: [Object] },
socketPath: undefined,
timeout: undefined,
method: 'GET',
path: '/v1/market/quotes?symbols=AAPL',
_ended: false,
parser:
HTTPParser {
'0': [Function: parserOnHeaders],
'1': [Function: parserOnHeadersComplete],
'2': [Function: parserOnBody],
'3': [Function: parserOnMessageComplete],
'4': null,
_headers: [],
_url: '',
_consumed: false,
socket: [Object],
incoming: [Circular],
outgoing: [Circular],
maxHeaderPairs: 2000,
onIncoming: [Function: parserOnIncomingClient] },
res: [Circular] } }