当前位置:编程学习 > VB >>

webQQ二次登录返回出错的问题

已经成功登录QQ网站,要登录QQ需要再post一次

通过httpwatch观察得到如下postdate数据
POST /channel/login2 HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: http://d.web2.qq.com/proxy.html?v=20110331002&callback=2
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 4.0.20506; .NET CLR 1.1.4322)
Host: d.web2.qq.com
Content-Length: 246
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: pt2gguin=o0479556915; pgv_pvid=9939982880; pgv_flv=10.0; pgv_r_cookie=11535462382; o_cookie=479556915; pgv_info=ssid=s5883071632&pgvReferrer=; ptui_width=360; ptui_height=187; uin=o0479556915; skey=@dXocUoTBo; ptisp=ctc; ptwebqq=d07acb059ca06e6f3bb70d8f889a6bcf9bee0c379e9afcf039566e78357108e4

r=%7B%22status%22%3A%22online%22%2C%22ptwebqq%22%3A%22d07acb059ca06e6f3bb70d8f889a6bcf9bee0c379e9afcf039566e78357108e4%22%2C%22passwd_sig%22%3A%22%22%2C%22clientid%22%3A%2213439812%22%2C%22psessionid%22%3Anull%7D&clientid=13439812&psessionid=null

----------------------------------------------------------------
从cookies中取得 ptweqq值 并重组如下  clientid 为一个随机值
 PostDate = "r=%7B%22status%22%3A%22online%22%2C%22ptwebqq%22%3A%22" & myC.ptwebqq & "%22%2C%22passwd_sig%22%3A%22%22%2C%22clientid%22%3A%229927991%22%2C%22psessionid%22%3Anull%7D&clientid=9927991&psessionid=null"


PostUrl = "http://d.web2.qq.com/channel/login2"

Inet1.Execute PostUrl, "POST", PostDate
正常应该返回如下 一个josn的数据
{"retcode":0,"result":{"uin":279925790,"cip":3737104921,"index":1073,"port":47631,"status":"online","vfwebqq":"9c0fc4f0864fe5a239f3ad74cb28758d0c0a927acf5b5ed1290f53cfe89990d1dd0b8ce0b11223aa","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3132382e36362e313132000013d500000981026e04003375951c6d0000000a4064586f63556f54426f6d000000289c0fc4f0864fe5a239f3ad74cb28758d0c0a927acf5b5ed1290f53cfe89990d1dd0b8ce0b11223aa","user_state":0,"f":0}}


但是,我运行上面代码后却返回出错信息

html><h1>Error occured:</h1><pre>{function_clause,[{app_util,get_value,
                            [r,
                             <<"r=%7B%22status%22%3A%22online%22%2C%22ptwebqq%22%3A%22e763f08816f9b24e861f63ba794a872fb98452045956db5cef82aeafc7b72ea6%22%2C%22passwd_sig%22%3A%22%22%2C%22clientid%22%3A%229927991%22%2C%22psessionid%22%3Anull%7D&clientid=9927991&psessionid=null">>]},
                  {app_util,prop,3},
                  {application_util,extract_call_info,3},
                  {application_util,invoke,3},
                  {api_web,loop,2},
                  {mochiweb_http,headers,4},
                  {proc_lib,init_p_do_apply,3}]}</pre></html>

百思不得其解,会的DX帮帮忙 没人,自己顶一下 我也碰到这问题了,请教 你用urllib2 建立一个keep-alive连接试试,猪头。 上面发错了,我也遇到同样的问题,求解 楼主解决了吗 你截获的数据(翻译后)是:
r={"status":"online","ptwebqq":"d07acb059ca06e6f3bb70d8f889a6bcf9bee0c379e9afcf039566e78357108e4","passwd_sig":"","clientid":"13439812","psessionid":null}&clientid=13439812&psessionid=null

你发送的数据(翻译后)是:
 PostDate = "r={"status":"online","ptwebqq":"" & myC.ptwebqq & "","passwd_sig":"","clientid":"9927991","psessionid":null}&clientid=9927991&psessionid=null"

很明显是少了一串字符。
不要更更改clientid试试。
我也遇到相同的问题·~~~有没有解决的啊~~~! 请问这个问题解决了吗??? 加上这个 就可以搞定了哦  
Content-Type: application/x-www-form-urlencoded
补充:VB ,  网络编程
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,