Apache User/Pass - 401 Authorization Required

I created a ruby script to acess my website and check it’s pages (and
keep it’s cookie). It worked well until the moment I atived the apache
authorization on my server.

Now I don’t know how to inform it’s user and password in my script. Is
there any api for that ?

Here is my atual code (which works fine when there is no need of inform

@http = Net::HTTP.new(website)
resp, data = @http.request_get(path, {‘User-Agent’ => USERAGENT})
print resp.body #returns error 401 Authorization Required
@cookie = resp.response[‘set-cookie’].split(’; ')[0] #hold the cookie

Thanks in advance,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs