Yahoo messenger API - 打开Comet样式通知的长期连接时出错

时间:2012-02-01 15:28:07

标签: android yahoo-messenger

我正试图让雅虎信使通知(彗星风格)在我的Android应用程序上运行,但我遇到了问题:

我有所有的oauth令牌+ IM cookie,我打电话通知服务器,但它响应  403 Bad IM cookie或URI凭证

发送的IM cookie是正确的,因为它与我从POST / session获得的那个相同。

电话:

POST到:http://rproxy2.messenger.yahooapis.com/v1/pushchannel/user_id?sid = T3qRkifs3BiGXCW4LOSoThi3lG2HvWNagr.mGA - & rand = -1131022177& count = 10& seq = 1& format = json& IM = 2x5A0IOr9Js_8er8BgSYUCB9fjB.d20FbKds7NdJdkzWK4u2A92k5dMrM72OetLz9.q70NQCwZpAqafQ5.XM- | QTvOT1rY3ukBC8o4Z0zeRg - &安培; oauth_consumer_key = dj0yJmk9cFNKb2NKbTdINEtFJmQ9WVdrOVpHMW1aVXhKTjJNbWNHbzlNamcyTnpNMU1UWXkmcz1jb25zdW1lcnNlY3JldCZ4PWJh&安培; oauth_nonce = 939bc51c9a594c7cbf903643bc10f7d1&安培; oauth_signature_method = PLAINTEXT&安培; oauth_timestamp = 1328108171163&安培;组oauth_token = A%3DosG_yqL.hxped9sV4ZMVD2A5vugclvEOSKIw85DOg17vQa8N1jQK6UcGqeLGLXKFalrxnYA_iA_ArmhbN6oJ_CEINGwiq7MWsVjO_vQT5bwhmcBMwBLByhusduuH2BFJw1Zd2w_uDj5fEUVMK9bMDzg.fYEpdm1uK OgwyYLPCwdkzW0w6ujPpaFAea7gwmsSBYHECzjXm8wduoe1Sw3rpJH4z9PGIe8Hkt3wrbyJpW9BuiU4g6OyE1f8nhzHVkcG _70KQiIR_oV3tP8_l4SCsbbHMvSzlyZjK1V6gJp0Q94fAcfuIWQ1Vd.iD.UZPEyzdzYK.k5Q6pE4H3At8czcXFOpmOL5eUwfbeQEtXePCL1b2v9oY4BxtH_dCUVTMhzQsV.YpKZV.ZRZzK8ThveL5gfGuqYcBZLHwVilQnQWo477Xw T10GbvWUzJ2EH4v5m9q.sGMViSIKWjbE2O6YfwhYXAgQMA3d8wQLL7IoY4QC0.IR4T8M_KnZVlKoi_EiED8VuK9h7h3emBZeXoM15rqGk2..HUJQEuIe1d0YbTPEGKdM.fbCcT7_Y0Szzw3abf9b1Xjzm8VkNSKL.LXAmy8c9PyNatUT_hKFmzmWMd1RRYfd8rF7i6i7Ec_cVv06QhwCQyKlEsCQh7UChUe9JykUmiA6JOm4JOpsbTQWS1Iec35zrltc4YwouUlMx.y6JbzB_VYL9jkzeuu&安培; oauth_version = 1.0&安培; oauth_signature = 2cd720831677df11508571218aed6c36c9cf2b51%26e57b0e111092b000a43b4ae9c928178fd5da4b9f 连接:保持活力

cookie:IM = 2x5A0IOr9Js_8er8BgSYUCB9fjB.d20FbKds7NdJdkzWK4u2A92k5dMrM72OetLz9.q70NQCwZpAqafQ5.XM- | QTvOT1rY3ukBC8o4Z0zeRg -

User-Agent:Dalvik / 1.2.0(Linux; U; Android 2.2; sdk Build / FRF91)

主持人:rproxy2.messenger.yahooapis.com

内容类型:application / x-www-form-urlencoded

内容长度:0

服务器响应: HTTP / 1.1 403错误的IM cookie或URI凭证

连接:关闭

我遵循docs的所有内容,不知道如何才能使其发挥作用。

感谢。

2 个答案:

答案 0 :(得分:1)

您的HTTP POST为空(Content-Length:0),文档状态为:

Note: even though all inputs are optional, the server 
still expects an empty POST body (JSON: "{}")

所以,将您的Content-Type更改为“application / json; charset = utf-8”并包含

{}

作为HTTP POST的正文。

答案 1 :(得分:1)

长期连接需要GET呼叫;请参阅“通知管理(Comet-Style Push)API”,here