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:
parent
5bf9d1f604
commit
0f60da5a89
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue