Home  >  Article  >  Web Front-end  >  如何在http请求头中添加cookie_html/css_WEB-ITnose

如何在http请求头中添加cookie_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:25:093315browse

情况是这样的:

我自己写了一个http客户端,url设置为 http://www.google.com的时候
应答包提醒302跳转,我根据location: 的内容设置新的url后再次请求,
发现需要添加cookie,

第一次的应答包 里面有
Set-Cookie: PREF=ID=7a28369b5191088b:FF=0:NW=1:TM=1383805940:LM=1383805940:S=15jcEL6R0waCLZ5Y; expires=Sat, 07-Nov-2015 06:32:20 GMT; path=/; domain=.google.com

我能根据这个Set-Cookie来设置 新一次请求头里面的cookie吗???
怎么设置请问?PREF=ID=7a28369b5191088b:FF=0:NW=1:TM=1383805940:LM=1383805940:S=15jcEL6R0waCLZ5Y;完全看不懂是什么东西


回复讨论(解决方案)

情况是这样的:

我自己写了一个http客户端,url设置为 http://www.google.com的时候
应答包提醒302跳转,我根据location: 的内容设置新的url后再次请求,
发现需要添加cookie,

第一次的应答包 里面有
Set-Cookie: PREF=ID=7a28369b5191088b:FF=0:NW=1:TM=1383805940:LM=1383805940:S=15jcEL6R0waCLZ5Y; expires=Sat, 07-Nov-2015 06:32:20 GMT; path=/; domain=.google.com

我能根据这个Set-Cookie来设置 新一次请求头里面的cookie吗???
怎么设置请问?PREF=ID=7a28369b5191088b:FF=0:NW=1:TM=1383805940:LM=1383805940:S=15jcEL6R0waCLZ5Y;完全看不懂是什么东西
你貌似进错板块了!!!到Web开发模块去问问吧!!!

已经帮你移到web版块!

已经帮你移到web版块!
谢谢你

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn