Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to use telnet to access http://stream.twitter.com/1/statuses/sample.json but when I connect to it I get a 401 Unauthorized error. Being able to specify username and password would allow me to get in. When doing this in a browser, I get a popup asking for it, is there a way to do the same through telnet?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If you want to use Telnet as an HTTP client, you have to speak fluent HTTP. In particular, if the website requires basic authentication, you'll have to send the authentication credentials in the header with your request.

It's probably best to prepare all the header lines in a separate file (e.g. Notepad) and then quickly copy/paste them into the Telnet session.

Alternatively, just use a ready-made HTTP client like wget or curl!

share|improve this answer

You can do Basic authentication with just a Base64 encoder program. (Of course, curl -u foo:bar http://stream.twitter.com/1/statuses/sample.json would be far easier, but your choice.)

However, Twitter doesn't support Basic anymore. The only available method is OAuth, which is far too complex to use manually. There are tools such as Twurl for accessing Twitter APIs.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.