-
Notifications
You must be signed in to change notification settings - Fork 319
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
HTTP.verb(url) should return an HTTP::Response object by default, not the body #37
Comments
I actually prefer it the way it is, since like 90% of the time you just want the body anyway. I'm not married to either way though, I'll use it regardless. |
The current API has a lot of limitations, especially around streaming. I do like the convenience which is what I was originally going for. Perhaps there can be convenience methods to get to the body in an easy way |
I really like the AREL-style method chaining and I think it is one of the major draws of this gem (to me, anyway), so maybe in uncertain cases it would be good to look at whatever AREL's philosophy is (which I think would probably point to the HTTP.get(url).body method you pointed to above). |
We could alias "#{HTTP.get(url)}" |
We'd need to delegate I have a broken WIP implementing some of these changes I can link which might help clarify this stuff ;) |
Yes, that’s what I meant. |
Code speaks louder than words. Here's a WIP. I need to finagle it a little more, pulling in some of the other stuff from Reel: #39 |
haven't used this gem yet but i think i'd prefer |
This can be closed, as #39 has been merged. |
The current API is probably overly simplified:
To get the response object, we have to do this:
Really it should probably be:
It'd be nice if body were an
HTTP::ResponseBody
object as well, then we could support streaming like this:We could also make it Enumerable so you can use it like this if you prefer:
The text was updated successfully, but these errors were encountered: