Https://api.twitter.com/oauth/request_token returns HTTP 301 sometimes


#1

I’m using php TwitterOAuth v0.2.0-beta2 by Abraham Williams

some data (http_info):

array(21) {
[“url”]=>
string(43) “https://api.twitter.com/oauth/request_token
[“content_type”]=>
string(9) “text/html”
[“http_code”]=>
int(302)
[“header_size”]=>
int(421)
[“request_size”]=>
int(456)
[“filetime”]=>
int(-1)
[“ssl_verify_result”]=>
int(1)
[“redirect_count”]=>
int(0)
[“total_time”]=>
float(0.131537)
[“namelookup_time”]=>
float(3.4E-5)
[“connect_time”]=>
float(0.025744)
[“pretransfer_time”]=>
float(0.088299)
[“size_upload”]=>
float(273)
[“size_download”]=>
float(0)
[“speed_download”]=>
float(0)
[“speed_upload”]=>
float(2075)
[“download_content_length”]=>
float(0)
[“upload_content_length”]=>
float(273)
[“starttransfer_time”]=>
float(0.131349)
[“redirect_time”]=>
float(0)
[“certinfo”]=>
array(0) {
}
}

should I follow the redirect?


#2

That method doesn’t tend to redirect… are you sure you’re actually reaching api.twitter.com?


#3

I don’t really understand your question.
If you mean this:
curl_setopt($ci, CURLOPT_URL, ‘https://api.twitter.com/oauth/request_token’);
than yes, this is like this in my code (I’m looking at the TwitterOAuth v0.2.0-beta2’s code).
Note that this only happens sometimes, and if I am authenticated, I can’t make requests either (without getting an error).