返回列表

express 中 req 对象中的参数

默认分类 2019/03/07 07:11

express 中 req 对象中的详细字段如下:

console.log(req)
undefined

_consuming:false
_dumped:false
_events:Object {}
_eventsCount:0
_maxListeners:undefined
_parsedOriginalUrl:Url {protocol: null, slashes: null, auth: null, …}
_parsedUrl:Url {protocol: null, slashes: null, auth: null, …}
_readableState:ReadableState {objectMode: false, highWaterMark: 16384, buffer: BufferList, …}
baseUrl:""
body:Object {token: ""}
client:Socket {connecting: false, _hadError: false, _handle: TCP, …}
complete:true
connection:Socket {connecting: false, _hadError: false, _handle: TCP, …}
cookies:Object {VISITORID: "100000013_839349588"}
destroyed:false
domain:null
fresh:false
headers:Object {host: "a.com", connection: "keep-alive", pragma: "no-cache", …}
  accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
  accept-encoding:"gzip, deflate"
  accept-language:"zh-CN,zh;q=0.9"
  cache-control:"no-cache"
  connection:"keep-alive"
  cookie:"VISITORID=100000013_839349588"
  host:"a.com"
  pragma:"no-cache"
  upgrade-insecure-requests:"1"
  referer:"http://a.com/test/base.html"
  user-agent:"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36"

host:"a.com"
hostname:"a.com"
httpVersion:"1.1"
httpVersionMajor:1
httpVersionMinor:1
ip:"::ffff:127.0.0.1"
ips:Array(0)
method:"GET"
next:function next(err) { … }
originalUrl:"/log/web?0000141551843660667http%3A%2F%2Flocalhost%2Ftest%2Fbase.html||000.000.0.0|1551843660667||1858x657|1||{}|614BE899-98F3-4844-5CF6-1A5379CA326D56304infoc"
paramlist:Object {0000141551843660667http://localhost/test/base.html||000.000.0.0|1551843660667||1858x657|1||{}|614BE899-98F3-4844-5CF6-1A5379CA326D56304infoc: ""}
params:Object {}
path:"/log/web"
protocol:"http"
query:Object {0000141551843660667http://localhost/test/base.html||000.000.0.0|1551843660667||1858x657|1||{}|614BE899-98F3-4844-5CF6-1A5379CA326D56304infoc: ""}
rawHeaders:Array(20) ["Host", "a.com", "Connection", …]
rawTrailers:Array(0) []
readable:true
readableHighWaterMark:16384
res:ServerResponse {domain: null, _events: Object, _eventsCount: 1, …}
route:Route {path: "/log/web", stack: Array(1), methods: Object}
secret:undefined
secure:false
session:Object {}
sessionStore:Object {uid: "", token: ""}
signedCookies:Object {}
socket:Socket {connecting: false, _hadError: false, _handle: TCP, …}
stale:true
statusCode:null
statusMessage:null
subdomains:Array(0)
trailers:Object {}
upgrade:false
url:"/log/web?0000141551843660667http%3A%2F%2Flocalhost%2Ftest%2Fbase.html||000.000.0.0|1551843660667||1858x657|1||{}|614BE899-98F3-4844-5CF6-1A5379CA326D56304infoc"
xhr:false
__proto__:IncomingMessage {app: }


>> 留言评论