【发布时间】:2021-01-26 03:54:55
【问题描述】:
我在尝试使用 express-session 将颤振应用程序与我的 nodejs 后端连接时遇到问题。在邮递员中,响应标头包含一个“Set-Cookie”-Header,但带有http.post(...) 的颤动标头不包含:标头:{content-length: 113, content-type: application/json; charset=utf-8}。
我需要一个 cookie 来保持经过身份验证的会话与护照。任何想法如何解决它?
颤振标题:
host: '127.0.0.1:3000', connection: 'keep-alive', 'content-length': '57', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36', 'content-type': 'application/json; charset=utf-8', accept: '*/*', origin: 'http://localhost:51879', 'sec-fetch-site': 'cross-site', 'sec-fetch-mode': 'cors', 'sec-fetch-dest': 'empty', referer: 'http://localhost:51879/', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7'
邮递员标头:'content-type': 'application/json', accept: '*/*', 'postman-token': '7c79280d-****-****-a985-c01395e50e08', host: 'localhost:3000', 'accept-encoding': 'gzip, deflate, br', connection: 'keep-alive', 'content-length': '66'
【问题讨论】:
标签: node.js flutter session header session-cookies