I'd like to attach the location of the user to a TWRequest. I've tried to modify the url (with something like this: "http://api.twitter.com/1/statuses/update.json?lat=37.76893497&long=-122.42284884"
) but the response was "401 Unauthorized" or "400 Bad Request".
My TWRequest:
TWRequest *postRequest = [[TWRequest alloc] initWithURL:
[NSURL URLWithString:@"http://api.twitter.com/1/statuses/update.json"] parameters:[NSDictionary dictionaryWithObject:[tweet text] forKey:@"status"] requestMethod:TWRequestMethodPOST];
Thanks in advance.
You attempt to perform request which requires authorization. Just initialize account property. Look at a good article about Twitter API: http://iosdevelopertips.com/core-services/ios-5-twitter-framework-part-2.html
UPD: And you can't mix POST and GET variables, I mean you have to specify all parameters to NSDictionary (POST parameters), not to URL.
UPD2: If geo-location isn't work, check if location is enabled for twitter account (go to Twitter site - Settings - Account - Tweet Location). Look at the REST API documentation on Twitter site update request section: