<p>hi, i try to retrieve cookies from a HTTP response, using Cookies() method, but it fails. Where i make a mistake ?
Set-Cookie header is present but method doesn't return any cookie.</p>
<p>The output : <a href="http://pastebin.com/g0693mPq" rel="nofollow">http://pastebin.com/g0693mPq</a></p>
<p>Thanks</p>
<hr/>**评论:**<br/><br/>lazy_jones: <pre><p>"/" is not a valid character for a cookie name...</p>
<p><a href="http://tools.ietf.org/html/rfc6265" rel="nofollow">http://tools.ietf.org/html/rfc6265</a> </p>
<p><a href="http://tools.ietf.org/html/rfc2616#section-2.2" rel="nofollow">http://tools.ietf.org/html/rfc2616#section-2.2</a></p></pre>l_a_m: <pre><p>ok Thanks.
The response is from a server. How can i create a cookie from this <em>invalid</em> response ?</p></pre>lazy_jones: <pre><p>probably by writing your own Cookies() method or by looking at the header resp.Header, replacing the invalid char by something like "DUMMY" and replacing it back in your cookie array after you called Cookies().</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传