node.js的http模块输出request参数

(只作为本人自己记录所用,参考需谨慎)
ServerResponse { //服务响应
domain: null, //域名
_events: { finish: [Function: resOnFinish] }, //项目
_eventsCount: 1, //项目数量
_maxListeners: undefined, //最大监听数量
output: [], /输出/
outputEncodings: [],/输出编码/
outputCallbacks: [],/输出回调函数/
outputSize: 0, /输出大小/
writable: true,/是否可写/
_last: false,/最后/
chunkedEncoding: true,/分块编码/
shouldKeepAlive: true,/活跃/
useChunkedEncodingByDefault: true,/使用默认分块编码/
sendDate: true,/发送时间/
_removedHeader: {}, /移除标题/
_contentLength: null, /内容长度/
_hasBody: true, /有子级/
_trailer: ”,/拖载/
finished: false, /已结束/
_headerSent: false, /发送/
socket: /网络上的两个程序通过一个双向的通信连接实现数据的交换,这个连接的一端称为一个socket。/
Socket {
_connecting: false, /吃醋连接状态/
_hadError: false, /错误/
_handle: /句柄/
TCP {
bytesRead: 78,/读取字节/
_externalStream: {},/外部流/
fd: 13, //不明白
reading: true, /读取中/
owner: [Circular], /所有者/
onread: [Function: onread], /读取中的内容/
onconnection: null, /连接中/
writeQueueSize: 0 },/写入流/
_parent: null, /父级/
_host: null,
_readableState: /可读状态/
ReadableState {
objectMode: false,/对象模块/
highWaterMark: 16384, /高水位/
buffer: [], /缓存/
length: 0, /高度/
pipes: null, /管道/
pipesCount: 0, /管道数量/
flowing: true,/活动的/
ended: false, /已经结束/
endEmitted: false, /结束放出/
reading: true,/读取中的 /
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, /域名/
_events: //项目
{ end: [Object], /结束/
finish: [Function: onSocketFinish], /一个通信端完成/
_socketEnd: [Function: onSocketEnd],/一个通信端结束/
drain: [Object], /释放/
timeout: [Function], /超时时间/
error: [Function: socketOnError], /错误/
close: [Object], /关闭/
data: [Function: socketOnData],/数据/
resume: [Function: onSocketResume],/重新连接/
pause: [Function: onSocketPause] }, /停止/
_eventsCount: 10, /项目数目/
_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: true, //同步
    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: true,/*打开一半*/
   destroyed: false, /*销毁*/
   _bytesDispatched: 0, /*字节销毁*/
   _sockname: null, /*链接端名字*/
   _pendingData: null,/*数据*/
   _pendingEncoding: '',
 server: 
  Server {
    domain: null,/*域名*/
    _events: [Object],/*项目*/
    _eventsCount: 3,/*项目数目*/
    _maxListeners: undefined,/*最大监听*/
    _connections: 1,/*链接*/
    _handle: [Object],/*句柄*/
    _usingSlaves: false,/*使用副本*/
    _slaves: [], /*副本*/
    _unref: false, /*取消回调函数的调用*/
    allowHalfOpen: true,/*开放一半*/
    pauseOnConnect: false, /*暂停链接*/
    httpAllowHalfOpen: false, /*http打开一半*/
    timeout: 120000, /*超时时间*/
    _pendingResponseData: 0,/*等待响应数据*/
    _connectionKey: '4:127.0.0.1:9999' }, /*链接键*/
 _server: 
  Server {
    domain: null,
    _events: [Object],
    _eventsCount: 3,
    _maxListeners: undefined,
    _connections: 1,
    _handle: [Object],
    _usingSlaves: false,
    _slaves: [],
    _unref: false,
    allowHalfOpen: true,
    pauseOnConnect: false,/*暂停链接*/  
    httpAllowHalfOpen: false,
    timeout: 120000,
    _pendingResponseData: 0,/*等待响应数据*/
    _connectionKey: '4:127.0.0.1:9999' },/* 链接简键*/
 _idleTimeout: 120000,/*超时时间*/
 _idleNext: { _idleNext: [Object], _idlePrev: [Circular] },
 _idlePrev: /*上一个下一个*/
  { [Function: utcDate]
    _onTimeout: [Function],
    _idleTimeout: 279,
    _idleNext: [Circular],
    _idlePrev: [Object],
    _idleStart: 9863 },
 _idleStart: 9855,
 parser: /*解析*/
  HTTPParser {/*http解析*/
    '0': [Function: parserOnHeaders], /*头部解析*/
    '1': [Function: parserOnHeadersComplete],/*头部完整解析*/
    '2': [Function: parserOnBody],/*解析body*/
    '3': [Function: parserOnMessageComplete],/*解析计算机信息*/
    '4': [Function: onParserExecute],/*在解析器执行*/
    _headers: [],/*头部*/
    _url: '',
    _consumed: true,/*?*/
    socket: [Circular],/*链接端*/
    incoming: [Object],/*入栈*/
    outgoing: null,/*出栈*/
    maxHeaderPairs: 2000, /*最大请求数*/
    onIncoming: [Function: parserOnIncoming] },
 on: [Function: socketOnWrap],
 _paused: false, 
 read: [Function],
 _consuming: true,/*消耗*/
 _httpMessage: [Circular] },/*http信息*/

connection: /内容/
Socket {
_connecting: false,/链接管道/
_hadError: false,/**/
_handle:
TCP {
bytesRead: 78, /读取字节/
_externalStream: {},/数据流/
fd: 13,
reading: true,
owner: [Circular],
onread: [Function: onread],
onconnection: null,/连接中/
writeQueueSize: 0 },/写入流/
_parent: null,
_host: null,
_readableState:
ReadableState {/可读状态/
objectMode: false,
highWaterMark: 16384,
buffer: [],/缓存/
length: 0,
pipes: null,/管道/
pipesCount: 0,
flowing: true,
ended: false,
endEmitted: false,
reading: true,
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,
_events:
{ end: [Object],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
drain: [Object],
timeout: [Function],
error: [Function: socketOnError],
close: [Object],
data: [Function: socketOnData],
resume: [Function: onSocketResume],
pause: [Function: onSocketPause] },
_eventsCount: 10,
_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: true,
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: true,
destroyed: false,
_bytesDispatched: 0,
_sockname: null,
_pendingData: null,
_pendingEncoding: ”,
server:
Server {
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
_connections: 1,
_handle: [Object],
_usingSlaves: false,
_slaves: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 120000,
_pendingResponseData: 0,
_connectionKey: ‘4:127.0.0.1:9999’ },
_server:
Server {
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
_connections: 1,
_handle: [Object],
_usingSlaves: false,
_slaves: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 120000,
_pendingResponseData: 0,
_connectionKey: ‘4:127.0.0.1:9999’ },
_idleTimeout: 120000,
_idleNext: { _idleNext: [Object], _idlePrev: [Circular] },
_idlePrev:
{ [Function: utcDate]
_onTimeout: [Function],
_idleTimeout: 279,
_idleNext: [Circular],
_idlePrev: [Object],
_idleStart: 9863 },
_idleStart: 9855,
parser:
HTTPParser {
‘0’: [Function: parserOnHeaders],
‘1’: [Function: parserOnHeadersComplete],
‘2’: [Function: parserOnBody],
‘3’: [Function: parserOnMessageComplete],
‘4’: [Function: onParserExecute],
_headers: [],
_url: ”,
_consumed: true,
socket: [Circular],
incoming: [Object],
outgoing: null,
maxHeaderPairs: 2000,
onIncoming: [Function: parserOnIncoming] },
on: [Function: socketOnWrap],
_paused: false,
read: [Function],
_consuming: true,
_httpMessage: [Circular] },
_header: ‘HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nDate: Fri, 21 Oct 2016 10:01:24 GMT\r\nConnection: keep-alive\r\nTransfer-Encoding: chunked\r\n\r\n’,
_headers: null,
_headerNames: {},
_onPendingData: [Function: updateOutgoingData],
statusMessage: ‘OK’,
statusCode: 200 }
/data/node.js:7
res,end(‘end’);
^

ReferenceError: end is not defined
at Server. (/data/node.js:7:7)
at emitTwo (events.js:87:13)
at Server.emit (events.js:172:7)
at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:536:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:103:23)
root@tian-virtual-machine:/data# node node.js
niod
ServerResponse {
domain: null,
_events: { finish: [Function: resOnFinish] },
_eventsCount: 1,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: true,
_removedHeader: {},
_contentLength: null,
_hasBody: true,
_trailer: ”,
finished: false,
_headerSent: false,
socket:
Socket {
_connecting: false,
_hadError: false,
_handle:
TCP {
bytesRead: 78,
_externalStream: {},
fd: 13,
reading: true,
owner: [Circular],
onread: [Function: onread],
onconnection: null,
writeQueueSize: 0 },
_parent: null,
_host: null,
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: false,
endEmitted: false,
reading: true,
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,
_events:
{ end: [Object],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
drain: [Object],
timeout: [Function],
error: [Function: socketOnError],
close: [Object],
data: [Function: socketOnData],
resume: [Function: onSocketResume],
pause: [Function: onSocketPause] },
_eventsCount: 10,
_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: true,
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: true,
destroyed: false,
_bytesDispatched: 0,
_sockname: null,
_pendingData: null,
_pendingEncoding: ”,
server:
Server {
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
_connections: 1,
_handle: [Object],
_usingSlaves: false,
_slaves: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 120000,
_pendingResponseData: 0,
_connectionKey: ‘4:127.0.0.1:9999’ },
_server:
Server {
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
_connections: 1,
_handle: [Object],
_usingSlaves: false,
_slaves: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 120000,
_pendingResponseData: 0,
_connectionKey: ‘4:127.0.0.1:9999’ },
_idleTimeout: 120000,
_idleNext: { _idleNext: [Circular], _idlePrev: [Circular] },
_idlePrev: { _idleNext: [Circular], _idlePrev: [Circular] },
_idleStart: 8355,
parser:
HTTPParser {
‘0’: [Function: parserOnHeaders],
‘1’: [Function: parserOnHeadersComplete],
‘2’: [Function: parserOnBody],
‘3’: [Function: parserOnMessageComplete],
‘4’: [Function: onParserExecute],
_headers: [],
_url: ”,
_consumed: true,
socket: [Circular],
incoming: [Object],
outgoing: null,
maxHeaderPairs: 2000,
onIncoming: [Function: parserOnIncoming] },
on: [Function: socketOnWrap],
_paused: false,
read: [Function],
_consuming: true,
_httpMessage: [Circular] },
connection:
Socket {
_connecting: false,
_hadError: false,
_handle:
TCP {
bytesRead: 78,
_externalStream: {},
fd: 13,
reading: true,
owner: [Circular],
onread: [Function: onread],
onconnection: null,
writeQueueSize: 0 },
_parent: null,
_host: null,
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: false,
endEmitted: false,
reading: true,
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,
_events:
{ end: [Object],
finish: [Function: onSocketFinish],
_socketEnd: [Function: onSocketEnd],
drain: [Object],
timeout: [Function],
error: [Function: socketOnError],
close: [Object],
data: [Function: socketOnData],
resume: [Function: onSocketResume],
pause: [Function: onSocketPause] },
_eventsCount: 10,
_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: true,
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: true,
destroyed: false,
_bytesDispatched: 0,
_sockname: null,
_pendingData: null,
_pendingEncoding: ”,
server:
Server {
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
_connections: 1,
_handle: [Object],
_usingSlaves: false,
_slaves: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 120000,
_pendingResponseData: 0,
_connectionKey: ‘4:127.0.0.1:9999’ },
_server:
Server {
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
_connections: 1,
_handle: [Object],
_usingSlaves: false,
_slaves: [],
_unref: false,
allowHalfOpen: true,
pauseOnConnect: false,
httpAllowHalfOpen: false,
timeout: 120000,
_pendingResponseData: 0,
_connectionKey: ‘4:127.0.0.1:9999’ },
_idleTimeout: 120000,
_idleNext: { _idleNext: [Circular], _idlePrev: [Circular] },
_idlePrev: { _idleNext: [Circular], _idlePrev: [Circular] },
_idleStart: 8355,
parser:
HTTPParser {
‘0’: [Function: parserOnHeaders],
‘1’: [Function: parserOnHeadersComplete],
‘2’: [Function: parserOnBody],
‘3’: [Function: parserOnMessageComplete],
‘4’: [Function: onParserExecute],
_headers: [],
_url: ”,
_consumed: true,
socket: [Circular],
incoming: [Object],
outgoing: null,
maxHeaderPairs: 2000,
onIncoming: [Function: parserOnIncoming] },
on: [Function: socketOnWrap],
_paused: false,
read: [Function],
_consuming: true,
_httpMessage: [Circular] },
_header: null,
_headers: null,
_headerNames: {},
_onPendingData: [Function: updateOutgoingData] }

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值