Apache User/Pass - 401 Authorization Required

K

Kleber A.

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
user/pass)

@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,
Kleber
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top