ruby - get cookie from response when there are two or more set-cookie headers
This is just pure ruby not rail.
I'm trying to code an auto login form to change some configurations o开发者_Python百科f my web hosting panel. There are two and more cookies returned.
I wish to get ruby version of this post How to handle multiple Set-Cookie header in HTTP response
open-uri also takes the last set-cookie header.
h1 = open("http://www.w3.org/") h1.meta['set-cookie']
get_fields()
solves this problem.
精彩评论