【发布时间】:2018-03-02 15:58:24
【问题描述】:
直到现在我还没有使用肥皂。我正在使用 node-soap 库 (https://github.com/vpulim/node-soap)。
我想与肥皂服务器通信。为了维护会话,服务器向我发送了 set-cookie 响应标头:'ASP.NET_SessionID=55....hrc; path/; HttpOnly' 以及 Login 方法响应。我想在 Logout 方法请求中发回这个 cookie。
我尝试: client.addHttpHeader('Cookie', 'ASP.NET_SessionID=55....hrc');
但在后续:
client.LogoutAsync({})
.then(result => {console.log(result);})
.catch(error => {console.log(error);});
我收到一个错误:
events.js:183 throw er; //Unhandled 'error' event
这是怎么回事,我怎样才能发回 Cookie 标头?
附:如果没有 cookie,它会按预期工作,返回我 Logout: false,这意味着发生错误是因为它无法识别会话(我想)。
【问题讨论】:
标签: node.js http soap node-soap