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

fixed example

This commit is contained in:
Julien Kirch 2010-02-20 19:45:34 +01:00
parent 5bf9d1f604
commit 0f60da5a89

View file

@ -93,8 +93,8 @@ Response.return! can be called to invoke the default response's behavior.
# the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user,
# since this might change the conditions under which the request was issued."
RestClient.get('http://my-rest-service.com/resource'){ |response, &block|
if [301, 302].include? code
follow_redirection &block
if [301, 302].include? response.code
response.follow_redirection &block
else
response.return! &block
end