Ruby http response help with getting cookie ID

jche5167-XzPaaFX+BT9zwX1tLqtjnA@public.gmane.org
Thu, 11 Aug 2005 10:41:52 -0000

Hi everyone,

I made a post earlier but I don''t think I made it clear enough what my
problem was so here it is.

I''m currently trying to use rsesame to connect Ruby and Sesame (RDF
database). I''m trying to communicate with my Sesame server through
http.

I''m able to log into Sesame via http, once login it sends me a http
response 200 along with a cookie id for the session. How can I retrieve
this cookie id and store it as a variable?

I need the cookie id to perform further transactions. In rsesame written by
Michiel Hobbelman he used the following code:
  if(resp.code == "200")
         resp.get_fields(''set-cookie'').each do|c|
           @session_id = $1 if(c =~ /sesame_sid=(.*);\s/)
         end
      else
        log "Login failed"
        log "Code = #{resp.code}"
        log "Message = #{resp.message}"
        resp.each {|key, val| log(sprintf("%-14s = %-40.40s\n", key,
val))
}
        return 1
      end

For some reason when I use it on my version of Ruby 1.8.2 stable release
for windows it comes up with the error ''methodNotFound for
get_fields''.
Help would be much appreciated.
Thanks,
June

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.