HTTP session

  • Thread starter Hardy Henneberg
  • Start date
H

Hardy Henneberg

Hi,
It seems like I'm not able to establish a session, when I use NET::HTTP.
Here is a snippet of my code:

@h = Net::HTTP.new('xx.yy.com', 443)
@h.use_ssl = true
@h.start {|aSession|

data = {}
data.store("auth_type" ,"basic");
data.store("username" ,"hh");
data.store("password" ,"yy");

response, data = aSession.post('/logon',nil,data,nil);
print response
print "\n"
print data
response, data = aSession.get('/myOrders',nil);
}
The last 'get' redirects my to the logon page as if the session is lost

here is the output:
#<Net::HTTPOK:0xf6f616c8>
#<Net::HTTPFound:0xf6f5de9c>
<head><title>Object moved</title></head>
<body><h1>Object Moved</h1>This object may be found <a HREF="/logon ...

is somebody able to spot the problem.

br
Hardy
 

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,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top