0

I am developing app which require to use OAuth1.0 for call API. I am able to Authenticate with OAuth1 and call GET method API.

But when I try to call POST method with passing JSON object. It give me "oauth_problem=signature_invalid"

Code for request :

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];

I am struggling with this. Any help will be appreciated. Thanks in advance.

girish_pro
  • 838
  • 9
  • 18

1 Answers1

0

I finally solve problem. In my case problem was with signature_method

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

before call request. And it works.

girish_pro
  • 838
  • 9
  • 18