Basic authentication with JQuery library ($.getJSON function)

1,584 views
Skip to first unread message

dmsiva

unread,
Nov 15, 2009, 7:21:04 PM11/15/09
to Twitter Development Talk
Hi,

How i can do the basic authentication with $.getJSON function? I just
can get json file without authentication:


var url = 'http://search.twitter.com/search.json?
&q=daniel&rqq=2&callback=?'
$.getJSON(url, function(data){
$.each(data.results, function(i,item){});

but if i want this url "http://twitter.com/statuses/
user_timeline.json" i need to authenticate.

Can you help me on this?

best regards

Raffi Krikorian

unread,
Nov 15, 2009, 9:49:01 PM11/15/09
to twitter-deve...@googlegroups.com
hmm.

http://lmgtfy.com/?q=jquery+basic+authentication+

(not being a great javascript/jquery coder, i may recommend doing a
$.ajax call instead of the $.getJSON -- in the beforeSend callback do
a request.setRequestHeader with the basic auth headers as documented
at http://en.wikipedia.org/wiki/Basic_access_authentication -- but
what do i know)

--
Raffi Krikorian
Twitter Platform Team
ra...@twitter.com | @raffi


Reply all
Reply to author
Forward
0 new messages