在我的 ios 应用程序中,当我尝试使用 video.comment.addcomment 向 vimeo 视频添加评论时,如果评论只有一个词,则它正在正确添加,但如果它超过一个词,则表示签名无效的错误。我使用的代码是:
NSString *new = [NSString stringWithString:commentis];
new = [new stringByReplacingOccurrencesOfString:@" " withString:@"+"];
NSString *url12 = @"http://vimeo.com/api/rest/v2?format=json&method=vimeo.videos.comments.addComment&video_id=123456&comment_text=good";
url12 = [url12 stringByReplacingOccurrencesOfString:@"123456" withString:videoplaying];
url12 = [url12 stringByReplacingOccurrencesOfString:@"good" withString:new];
NSURL *urlinfo = [[NSURL alloc] initWithString:url12];
OAMutableURLRequest *request3 = [[OAMutableURLRequest alloc]initWithURL:urlinfo consumer:consumer token:tokenfi realm:nil signatureProvider:nil];
我理解错误。我得到的 json 响应是
{
err = {
code = 401;
expl = "The oauth_signature passed was not valid.";
msg = "Invalid signature";
};
"generated_in" = "0.0124";
stat = fail;
}
但如果我将评论作为单个词给出,它工作正常。