2016-02-15 31 views
0

我正在开发需要使用OAuth1.0调用API的应用程序。 我能够使用OAuth1进行身份验证并调用GET方法API。AFJSONRequestOperation创建“oauth_problem = signature_invalid”

但是,当我尝试通过传递JSON对象调用POST方法。它给我 “oauth_problem = signature_invalid”

规范要求:

NSMutableURLRequest *request = [self.twitterClient requestWithMethod:@"POST" path:apiURL parameters:jsonObj]; 

    AFJSONRequestOperation *jsonOperation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { 
    NSLog(@"Success: %@", JSON); 

    } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) { 
    NSLog(@"Error: %@", error); 
    }]; 
    [jsonOperation start]; 

我这个苦苦挣扎。任何帮助将不胜感激。提前致谢。

+0

请帮帮我..! –

回答

0

我终于解决了问题。 在我的情况下,问题是用signature_method

I set .. self.twitterClient.signatureMethod = AFPlainTextSignatureMethod;

呼叫请求前。它的工作原理。

相关问题