Tom
On 9/10/10 11:50 PM, MTCoder wrote:
> i have written code (working code for a client app) up to the point of
> posting/reading to a twitter timeline.
> The user has allowed my app access and i have the token and token
> secret.
> Also i have double checked the signature and everything else and they
> all seem correct ( http://hueniverse.com/2008/10/beginners-guide-to-oauth-part-iv-signing-requests/
> is a awesome for this).
>
> Now my problem:
> whenever i call to get the timeline or post a new status to the
> timeline i get the return of
> "Status: 500 Internal Server Error" in the response header and the
> body is an html page saying "Something is technically wrong."
>
> So is them my problem or Twitters?
>
> base string:
> GET&http%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses
> %2Fhome_timeline.xml&oauth_consumer_key%3DKKKKKKKKKKKKK%26oauth_nonce
> %3D4E3431495445554D4E413D344E44443D%26oauth_signature_method%3DHMAC-
> SHA1%26oauth_timestamp%3D1284154584%26oauth_token%3DTTTTTTTTTTTTTTTT
> %26oauth_version%3D1.0
>
>
>
> my request:
>
> GET /1/statuses/home_timeline.xml HTTP/1.1
> Authorization: OAuth realm="",
> oauth_nonce="4E3431495445554D4E413D344E44443D",
> oauth_signature_method="HMAC-SHA1", oauth_timestamp="1284154584",
> oauth_consumer_key="KKKKKKKKKKKKK", oauth_token="TTTTTTTTTTTTTTTT",
> oauth_signature="zd8hazoYu5azlVDhnJ8/mr1jkwk=", oauth_version="1.0"
>
> also, im using the Chilkat HTTP lib on this one, in C++:
>
> CkHttp http;
> CkHttpRequest req;
> CkString header;
>
> sig = CreateOauthSig(base_string);
>
> // Build an HTTP POST Request:http://twitter.com/statuses/update.xml
> req.UseGet();
> req.put_Path("/1/statuses/home_timeline.xml");
>
> //build the header
> header.append("OAuth realm=\"\", oauth_nonce=\"");
> header.appendStr(nonce);
> header.append("\", oauth_signature_method=\"HMAC-SHA1\",
> oauth_timestamp=\"");
> header.appendStr(time_str);
> header.append("\", oauth_consumer_key=\"KKKKKKKKKKKKKK\", oauth_token=
> \"");
> header.appendStr(token);
> header.append("\", oauth_signature=\"");
> header.appendStr(sig);
> header.append("\", oauth_version=\"1.0\"");
>
> req.AddHeader("Authorization",header.getAnsi());
>
> BOOL success=FALSE;
>
> const char * domain;
> long port;
> bool ssl;
> domain = "api.twitter.com";
> port = 80;
> ssl = false;
>
>
> CkHttpResponse *resp = 0;
> resp = http.SynchronousRequest(domain,port,ssl,req);
>
>
>
>
> Please let me know what other info might help,
> MTCoder
>
Tom