HTTP response can't retrieve cookies

polaris · · 495 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<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&#39;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>&#34;/&#34; 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 &#34;DUMMY&#34; and replacing it back in your cookie array after you called Cookies().</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

495 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传