I'm trying to get a response data from dropbox oauth as described here
Now i dont know why it keeps saying {"error": "Invalid OAuth request."}
Here is a my complete code for requesting token:
-(void)requestTokenSecret
{
NSString* oauthVersion=@"1";
NSString* oauth_signature_method=@"PLAINTEXT";
NSString* postHeader = [NSString stringWithFormat: @"Authorization: OAuth oauth_version=\"%@\", oauth_signature_method=\"%@\", oauth_consumer_key=\"%@\", oauth_signature=\"%@&\"",oauthVersion,oauth_signature_method,APP_KEY,APP_SECRET];
NSLog(@"URL HEADER: %@",postHeader);
NSData* postHeaderData = [postHeader dataUsingEncoding:NSUTF8StringEncoding];
NSMutableURLRequest* request= [[NSMutableURLRequest alloc]init];
[request setURL:[NSURL URLWithString:@"https://api.dropbox.com/1/oauth/request_token"]];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:[NSString stringWithFormat:@"%d",[postHeaderData length]] forHTTPHeaderField:@"Content-Length"];
[request setHTTPBody:postHeaderData];
NSURLConnection* conn = [[NSURLConnection alloc]initWithRequest:request delegate:self];
[conn start];
if(conn)
{
NSLog(@"Connected");
}
else
NSLog(@"Connected");
}