Posts tagged restclient
- Access response headers:
- Configurable timeout, contributed by Marc-André Cournoyer:
resource = RestClient::Resource.new 'https://example.com', :timeout => 20
- require ‘restclient’ is now the preferred notation, though require ‘rest_client’ will continue to be supported indefinitely.
Restclient 0.8 released with new features:
- The restclient binary can take get/put/post/delete as the first argument:
A few more chances for you to catch me in person:
- Silicon Valley Ruby on Rails Meetup, Sept 25 @ 7pm (this Thursday). My presentation is titled: Instant Rails Deployment to Heroku with Git. Heroku’s API and Git integration is our secret weapon, so I’m pleased to be giving a talk focused entirely on these tools.
- RubyConf 08, Nov 7 @ 1:15pm. Blake Mizerany and I will be presenting Lightweight Web Services with Sinatra and RestClient. Besides shamelessly pimping our respective open source projects, we’ll talk about why we think the future is all about small apps loosely coupled into a larger system.
I keep thinking I’ll run out of things to add to RestClient, but then I keep wanting more features. So here comes 0.7, with gzip/deflate support and client-side logs.Continue reading »
RestClient 0.6 includes an interactive shell contributed by Blake Mizerany. Lay down your
curl, for we now have a Ruby Way to fetch resources at the command line!
gem install rest-client for new features:
- SSL support
- User/password embedded in the url (e.g. https://joe:email@example.com)
- Subresource nesting with syntax (e.g.
site['posts/1/comments'].get) (more examples)
- Better exception classes with access to the response object and more readable output in irb
REST is part of the Ruby Way. Which is why I’m surprised that every time I go to access a RESTful resource, I find myself writing some sort of ad-hoc rest client. Net::HTTP is too low level - you’ve got to write at least three or four fairly dense lines of code even for a relatively simple GET or PUT.Continue reading »