Get file from web page that require user and pass

K

Kga Agk

I want to connect to a web site that require user name and password.
This adress holds a file, like a txt, image pdf and so on. I want to get
this payload. (Only going to check if the file is is empty or not).


I Have tryed a billion different ways, but i cant get it to work. I get
errors and stuff. The last error is like this.

/usr/lib/ruby/1.8/net/http.rb:560:in `initialize': getaddrinfo: Name or
service not known (SocketError)
from /usr/lib/ruby/1.8/net/http.rb:560:in `open'
from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
from /usr/lib/ruby/1.8/timeout.rb:53:in `timeout'
from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
from /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
from /usr/lib/ruby/1.8/net/http.rb:542:in `start'
from /usr/lib/ruby/1.8/net/http.rb:1035:in `request'
from waste/waste.rb:20:in `get_feed'

And here i even tryed a code som other guy made, it is on this site:
http://blog.patrick-morgan.net/2007/02/ruby-https-with-http-basic-auth.html


So how do i get the file that are stored on a web page that require
username and password?
 
M

Michael Morin

I want to connect to a web site that require user name and password.
This adress holds a file, like a txt, image pdf and so on. I want to get
this payload. (Only going to check if the file is is empty or not).


I Have tryed a billion different ways, but i cant get it to work. I get
errors and stuff. The last error is like this.

/usr/lib/ruby/1.8/net/http.rb:560:in `initialize': getaddrinfo: Name or
service not known (SocketError)
=A0from /usr/lib/ruby/1.8/net/http.rb:560:in `open'
=A0from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
=A0from /usr/lib/ruby/1.8/timeout.rb:53:in `timeout'
=A0from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
=A0from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
=A0from /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
=A0from /usr/lib/ruby/1.8/net/http.rb:542:in `start'
=A0from /usr/lib/ruby/1.8/net/http.rb:1035:in `request'
=A0from waste/waste.rb:20:in `get_feed'

And here i even tryed a code som other guy made, it is on this site:
http://blog.patrick-morgan.net/2007/02/ruby-https-with-http-basic-auth.ht= ml


So how do i get the file that are stored on a web page that require
username and password?

I address authentication in my Twitter articles. Here's one that show
you how to use basic_auth.

http://ruby.about.com/od/networking/qt/tweetruby.htm

Without seeing your code, it's hard to say where exactly you went wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,961
Messages
2,570,131
Members
46,689
Latest member
liammiller

Latest Threads

Top