Posts tagged rest

Jan03

RestClient 1.1: Multipart Uploads, and a New Maintainer

restclient ruby http | comments

I’ve given over maintenance of RestClient to Julien Kirch (archiloque). He's got a 1.1 release now in Gemcutter/Rubyforge, with some hot new features:

Continue reading »

May28

RestClient 1.0, Now With SSL Client Certificates

restclient | comments

With HTTP basic auth starting to get the cold shoulder (passwords are basically low-complexity symmetric keys, not too hot for truly secure authentication), and OAuth experiencing growing pains, what options are available today for truly secure RESTful authentication?

Continue reading »

Apr07

Client-Side Caching with Cacheability

restclient rack caching | comments

Cyril Rohr gives us Cacheability, a caching HTTP client which cleverly mashes together RestClient and Rack::Cache. It can cache results in memory, on the filesystem, or in memcached. Grab a copy:

Continue reading »

Mar24

Versioning REST

rest | comments

Peter Wiliams suggests versioning REST APIs with the Accept header. I agree that putting the version in the URI (e.g. GET /api/v1/resource) is ugly - for the Heroku client I used a custom header (X-Heroku-API-Version), which seems preferrable to me because you don’t pollute your mimetypes.

Jan24

RestClient 0.9

restclient | comments

New stuff:

  • Access response headers:
RestClient.get('http://example.com/pic.jpg').headers[:content_type]
  • 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.
Continue reading »

Dec03

Rubyconf Video

events sinatra restclient | comments

Nov07

Rubyconf Slides

events sinatra restclient | comments

Oct14

RestClient 0.8

restclient | comments

Restclient 0.8 released with new features:

  • The restclient binary can take get/put/post/delete as the first argument:
Continue reading »

Sep22

Upcoming Appearances

restclient events sinatra | comments

A few more chances for you to catch me in person:

Aug19

A Logging RestClient

restclient | comments

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 »

Aug12

Don't Fear the URLs

rest mvc sinatra | comments

I like models. They do the heavy lifting. They’re easy to spec. You can grab them at the console or from script/runner with ease.

Continue reading »

Aug08

Ruby Libs for Making Web Calls

http ruby restclient rest | comments

John Nunemaker created HTTParty, a library for making web requests. So the options for making web calls from Ruby are now:

Continue reading »

Aug01

RestClient 0.6

restclient | comments

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!

Continue reading »

Jun26

Service-Oriented Architectures

rest heroku soa | comments

I’ve always liked to build systems with a bunch of small apps that talk to each other through various protocols. Orion and I built TrustCommerce in this manner, and that gave it some pretty impressive fault-tolerance and scalability.

Continue reading »

Jun21

RestClient 0.5

restclient | comments

gem install rest-client for new features:

  • SSL support
  • User/password embedded in the url (e.g. https://joe:mypass@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
Continue reading »

May12

Firefox REST Plugin

rest | comments

While we wait for web broswers to become fully REST-capable, Poster is a handy Firefox plugin for sending any type of HTTP request, including all four verbs and different content types. I usually use rest-client at a rush shell for one-offs; but if you need your browser’s cookies for a call that can’t be authenticated with http basic auth, or you just want a dialog that shows all the options visually, Poster is quite handy.

Apr16

Model + Controller = Unified Resource?

rest mvc | comments

Harry Fuecks thinks MVC might be overrated. In a world of web resources, why not combine models and controllers together? Imagine replacing ActiveRecord (or my new favorite, DataMapper) with a server-side version of ActiveResource. GET, POST, PUT, and DELETE are filled in automatically, and you can extend their functionality and add suport methods.

Continue reading »

Apr05

rest-client 0.4

restclient | comments

The fourth release of rest-client includes a patch from Greg Borenstein that makes it easy to send form-urlencoded data by passing a hash instead of a string as the payload:

Continue reading »

Mar16

to_xml

activerecord rest | comments

When serving up an ActiveRecord as resource, you can use options like :only and :except to to_xml. But in most cases, you want the same fields served every time - on create, update, and get. So put the options into the class itself:

Continue reading »

Mar14

REST Enlightenment

http rest | comments

REST appealed to me right from the get-go. But it’s taken me a surprisingly long time to wrap my head around all of its implications. Some of my recent projects - building the fully RESTful Heroku API, working with Mike Clark on the Nested Resources recipe for his upcoming book, and writing rest-client - have allowed me to finally get a handle on how all the pricinples of REST fit together into a unified whole.

Continue reading »

Mar11

Rest Client 0.2

http restclient rest | comments

Based on Dan Kubb's suggestion, I’ve implemented an ActiveResource-style accessor for rest-client. This also supports basic auth, so now:

Continue reading »

Mar09

Rest Client

http ruby restclient rest | comments

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 »