Hi All,

I've been reading the API documentation and this support group as well
but I can't find an answer, or a solution, to my problem.
I've been writing some js code using the Twitter API but every time I
perform a call I got back the error in subject: HTTP 400 Bad Request
and no response at all.

Here follows a pice of the code I am using (with the prototypejs
framework):
==
new Ajax.Request('http://twitter.com/statuses/public_timeline.json', {
  method: 'GET',
  encoding: 'UTF-8',
  onLoading: function(){
    debug.update('Loading...');
  },
  onSuccess: function(transport) {
    debug.update("SUCCESS: " + transport.responseJSON  + "<br/>")
  },
  onException: function(transport, exception){
    debug.update("EXCEPTION: " + exception);
  }
});
==

here are the requests headers:
==
Host: twitter.com

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:
1.9.1.1) Gecko/20090715 Firefox/3.5.1

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Origin: null

Access-Control-Request-Method: GET

Access-Control-Request-Headers: x-prototype-version,x-requested-with
==

and the response headers:
==
Date: Tue, 04 Aug 2009 20:20:48 GMT

Server: hi

Last-Modified: Tue, 04 Aug 2009 20:20:48 GMT

Status: 400 Bad Request

X-RateLimit-Limit: 150

X-RateLimit-Remaining: 135

Pragma: no-cache

Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-
check=0

Content-Type: application/json; charset=utf-8

X-RateLimit-Reset: 1249417836

Expires: Tue, 31 Mar 1981 05:00:00 GMT

X-Revision: adb502e2c14207f6671fe028e3b31f3ef875fd88

X-Transaction: 1249417248-99305-1720

Set-Cookie:
_twitter_sess=BAh7CDoMY3NyZl9pZCIlN2NmZWIyZmU0NTQ3NjMyZGU1MThlNjZjODc0MGY2%250AODM6B2lkIiVlMzg5ZTViMmYzZjkwM2ExZDExMmRhMmM3NDFjNGMwOSIKZmxh
%250Ac2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoK
%250AQHVzZWR7AA%253D%253D--5a76f810fb5fde72f43634d7423aff19f28b3aa7;
domain=.twitter.com; path=/

Vary: Accept-Encoding

Content-Encoding: gzip

Content-Length: 99

Connection: close
==


Thanks to all for your help.

0m4r

Reply via email to