0

Through all Google I found this example: http://adam.heroku.com/past/2008/8/8/ruby_libs_for_making_web/

I can't find more tutorial stuff on this subject: A step by step and nice tutorial to teach how to use Net::HTTP with Rails for creating a REST client. Even if It is a RailsCast or a Chapter in a book that explains this in a good way please let me know.

mathieugagne
  • 2,465
  • 1
  • 17
  • 18
Bohn
  • 26,091
  • 61
  • 167
  • 254
  • 1
    What are you trying to achieve? – mathieugagne Feb 04 '13 at 16:44
  • Being able to write a RailsREST client with Net/HTTP so it can connect to another Rails project that is the Services part of it and mostly do a "get". – Bohn Feb 04 '13 at 16:53
  • So like a Sinatra-type app? http://www.sinatrarb.com/ – mathieugagne Feb 04 '13 at 17:02
  • @mathieugagne : Not exactly, I read first chapter of Paul Dix book that he was using Sinatra for its REST part and his own Typheous for the client side but I am told that I Must use built in Rails REST for the service side and Net::HTTP for the client side of it. But I have nothing to start learning the NetHTTP part with. – Bohn Feb 04 '13 at 17:05
  • So what about RailsAPI? It's a subset of Rails. They take some of the rake middlewares away and focused only on keeping it as lean as possible. It basically becomes a one-purpose API-like app. – mathieugagne Feb 04 '13 at 17:20
  • https://github.com/rails-api/rails-api – mathieugagne Feb 04 '13 at 17:20

1 Answers1

1

There's no real standard way, because there's no real standardised way of REST web service discovery as far as I'm aware? If you're writing the WS yourself then it's up to you. There's some handy Net:HTTP stuff here. There's even a section on RESTful methods.

If you like, write your own class which interfaces Net:HTTP.

Mike Campbell
  • 7,921
  • 2
  • 38
  • 51