Hi,
Im having lots of trouble trying to sort out this issue and am at a lost. Hopefully someone can point me in the right direction. I’m busy dev-ing an app, of which part is to follow someone else. Everything I’ve got is working (Get Mentions, Get Direct Message, Get Followers, Get Friends), except following someone. Whenever I try this I get “Could not authenticate with OAuth.”. I presume it cant be the tokens etc that has expired as Im using the same ones for the functions mentioned above. The only difference is that the ones above is GET’s where the following (friendship/create) is POST. I’ve checked my BASESTRING and its 100% if Im using http://quonos.nl/oauthTester/ to check it. Also the same basestring (except for GET/POST in it) that Im using for the functions above.
All the functions im using, is the same (basestring generation, nonce, timestamp, etc).
The headers is as follow:
POST /1/friendships/create.json HTTP/1.0
Accept: /
Referer: http://www.XZXZXZXZXZXZX.com
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/4.0 (compatible; ICS)
Host: api.twitter.com
Content-Length: 17
Authorization: OAuth oauth_consumer_key=“XXXXXXXXXX”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1310826943”, oauth_nonce=“NACFBZVEVWEBSZSYYDTC”, oauth_version=“1.0”, oauth_token=“XXXXXXXXXXXXXX”, oauth_signature=“Qi4g5UfhxRz5EkpwrtGGvCQOfBg%3D”
The server response is as follow:
status code=401
headers=HTTP/1.1 401 Unauthorized
Date: Sat, 16 Jul 2011 14:36:31 GMT
Server: hi
Status: 401 Unauthorized
WWW-Authenticate: OAuth realm="http://api.twitter.com"
X-Runtime: 0.00999
Content-Type: application/json; charset=utf-8
Content-Length: 88
Cache-Control: no-cache, max-age=300
Set-Cookie: k=41.133.180.120.1310826991812465; path=/; expires=Sat, 23-Jul-11 14:36:31 GMT; domain=.twitter.com
Set-Cookie: guest_id=v1%3A131082699181691445; domain=.twitter.com; path=/; expires=Tue, 16 Jul 2013 02:36:31 GMT
Set-Cookie: original_referer=ZLhHHTiegr8wMX3KjMz3b%2BaDc9Eazq28; path=/
Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCNGQYDMxAToHaWQiJTIxM2JkZDliMGQxYTlj%250AOWFkNmMxOTFmMGZlNjBkOTljIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA–6c3a1f14db84adc7ec271f9bf716c5925198aba3; domain=.twitter.com; path=/; HttpOnly
Expires: Sat, 16 Jul 2011 14:41:31 GMT
Vary: Accept-Encoding
Connection: close
Any help would be appreciated.
Thank you