I'm trying to post a form to a site using net/http. I think it works,
I'm not sure, but does net/http store cookies? Because I think that's
the problem: loggin in isn't very hard, but the cookies aren't stored.
Does anyone know of a way to do that?
--
Best regards,
Chris Eidhof
def login(username, password, domain = nil)
path = 'Login'
data = %Q{<?xml version="1.0" ?>
<authorization>
<username><![CDATA[#{username}]]></username>
<password><![CDATA[#{password}]]></password>\n}
data << %Q{<domain><![CDATA[#{domain}]]></domain>\n} if domain
data << %Q{</authorization>\n}
@headers.delete("cookie")
resp = post(path, data)
raise "DocuShare login failed" if resp.code != "200"
@headers["cookie"] = resp["set-cookie"]
resp["docushare-handle"]
end
HTH,
Vance