1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00
Commit graph

5 commits

Author SHA1 Message Date
Andy Brody
00e3358489 Use request cookie jar as basis for response.
Refactor response cookie handling to use our new Request#cookie_jar.
Instead of creating a jar from scratch, make a copy of the request's
cookie jar and populate it with any additional cookies from the response
headers.

Also refactor the redirection code to use this cookie jar, which solves
the question of how to handle cookies from the original request.
2016-06-05 19:14:39 -04:00
Andy Brody
082c615f90 Fix up tests for URI parsing changes. 2016-05-15 22:44:52 -04:00
Andy Brody
e85a954ed8 Remove args from Response and normalize method.
It is redundant and confusing to pass both the Request args and the
Request when creating a RestClient::Response. Instead, when the response
object needs to read args from the request, access them on the request
object itself. For determining the HTTP method of the request, switch to
calling RestClient::Request#method.

Also normalize the Request#method to be a lowercase string. This makes
handling of redirection and other method-specific functionality actually
work regardless of how the method was provided to Request.new (:get,
'GET', 'get').

Fixes: #461
Fixes: #462
Fixes: #463
2016-05-01 16:57:54 -04:00
Andy Brody
4932e7e358 Deprecate :timeout in favor of :read_timeout.
This better matches the behavior of Net::HTTP and will make it more
obvious to users what the option actually does.
2015-03-14 15:18:36 -07:00
Andy Brody
5ce0c6ebde Fix up tests for encoding changes.
Add a `.to_hash => {}` for the Net HTTP response mocks.
2015-03-13 18:00:51 -07:00