Broken link check for Authenticated Url using http,uri

P

Priyank Shah

Hi All,

I work on check all links in a site, so for that i fetch all links from
page and

check its http response and its work fine for urls which have not any

authentication. but my many urls need to pass username and password so
for that

i found following code but it not work for my url,

require 'net/http'
require 'uri'

url = URI.parse('http://api.del.icio.us/v1/tags/get')
req = Net::HTTP::Get.new(url.path)
req.basic_auth 'username', 'password'
res = Net::HTTP.new(url.host, 80)
response = res.start {|http| http.request(req)}
puts response.message

This work fine but in my url, there are not extra "/v1/tags" path, it
ask for

username and password when i type doamin name like "http://test.com" and
it

shows popup for username and password.

and i everytime get authentication required as response message using
above

code, even i pass credentials.



so what can i do for that ? can any one help me ?

Thanks,
Priyank Shah
 

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

Forum statistics

Threads
473,708
Messages
2,569,347
Members
44,653
Latest member
Angus30T19

Latest Threads

Top