【发布时间】:2011-09-03 20:54:34
【问题描述】:
我正在为 iPhone 构建一个 twitter 客户端,并且我正在使用 OAuth 来验证我对 twitter 的请求,
现在我能够获得家庭时间线,甚至发布推文(不包含任何空格或符号)当我尝试发布包含空格的推文时问题就开始了,例如它给了我:{“错误":"签名不正确","request":"\/1\/statuses\/update.json"}
例如推文:“ThisIsATweet”有效,但推文:“这是一条推文”无效 这是我的 http 请求正文代码:
NSData* body =[NSString stringWithFormat:@"status=%@",[self percentageEncoding:tweet]];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setValue:[NSString stringWithFormat:@"%d",[body length]] forHTTPHeaderField:@"Content-Length"];
[request setHTTPBody:[body dataUsingEncoding:NSISOLatin1StringEncoding]];
【问题讨论】:
-
你能写下在推特上发帖的网址吗?您创建请求时使用的那个?
标签: objective-c ios oauth twitter twitter-oauth