Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callbacks for response status codes #32

Closed
kaiwren opened this issue Sep 14, 2010 · 2 comments
Closed

Callbacks for response status codes #32

kaiwren opened this issue Sep 14, 2010 · 2 comments

Comments

@kaiwren
Copy link
Contributor

kaiwren commented Sep 14, 2010

API to allow callbacks based on the HTTP status code of a response. Should support ranges. Tentatively something like
'http://ooga.com/foo'.to_uri(:on_respose_code => {
401 => lambda {|response| raise UnauthorizedException},
500..599 => lambda do |response|
Wrest.logger.error response.body
raise ServerDiedException
end
}
).get.deserialise

This is closely related to feature request #49.

@jasim
Copy link
Contributor

jasim commented Dec 28, 2010

Using option :callback instead of :on_response_code.

@jasim
Copy link
Contributor

jasim commented Jan 3, 2011

kaiwren@f7051ac

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants