Go Back   CodingForums.com > :: Server side development > Ruby & Ruby On Rails

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-15-2012, 07:33 PM   PM User | #1
Keysle
New Coder

 
Join Date: Nov 2010
Posts: 33
Thanks: 12
Thanked 0 Times in 0 Posts
Keysle is an unknown quantity at this point
Can someone explain to me what is "RESTful"

I wiki'd it and my mind was blown. I suppose the process of defining it comes with what angle of perception the learner is coming from.

I know some PHP and some MySQL.
I can store stuff, and echo stuff. Loop through arrays and make session and cookie variables. Oh yeah, send emails too. These tid bits of knowledge can get one surprisingly far, but I'm still lost when it comes to the meaning of "RESTful". Can someone explain it to someone with my background?
Keysle is offline   Reply With Quote
Old 06-01-2012, 09:25 AM   PM User | #2
kaizenfury7
New to the CF scene

 
Join Date: May 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
kaizenfury7 is an unknown quantity at this point
When it comes to Ruby on Rails, RESTful is a way for writing web services.

For instance, let's say you want to build an RESTful api to manage cars:

http://host/cars - when you do a GET on this URL, you should get a list of cars
http://host/cars/1 - when you do a GET on this URL, you are tring to get a car that has the ID of 1
http://host/cars/1 - when you do a PUT on this URL, it means you are trying to update the car with the ID of 1
http://host/cars/1 - when you do a DELETE on this URL, it means you are trying to delete the car with the ID of 1

This isn't the only way of doing this, you can custom design your API and name things however you want or use whatever method (GET/PUT/POST/DELETE) you want to try to do those 4 actions (list, read, update, delete). However, the REST way follows some principles that allows you and third parties to interact more easily with your API because of the assumptions it makes.

Here's there definition from the Ruby on Rails docs:
http://guides.rubyonrails.org/getting_started.html#rest

Last edited by kaizenfury7; 06-01-2012 at 09:37 AM..
kaizenfury7 is offline   Reply With Quote
Old 09-17-2012, 09:33 AM   PM User | #3
annaharris
New Coder

 
Join Date: May 2012
Location: USA
Posts: 83
Thanks: 0
Thanked 4 Times in 4 Posts
annaharris is an unknown quantity at this point
One big part of the whole restful thing is that you should use the different HTTP methods to represent different actions. Here you can find brief tutorial on creating RESTful web services using the Ruby on Rails framework : http://www.youtube.com/watch?v=J6r_l3cAS9s
annaharris is offline   Reply With Quote
Old 12-05-2012, 06:44 AM   PM User | #4
bparker1084
New to the CF scene

 
Join Date: Oct 2012
Location: San Jose
Posts: 9
Thanks: 0
Thanked 2 Times in 2 Posts
bparker1084 is an unknown quantity at this point
REST is a set of architectural principles that stipulate that web services should maximally leverage HTTP and other web standards, so that programs gain all the good stuff that people already can get out of the web. REST is often contrasted with SOAP web services, and other "remote procedure call" oriented web services.
bparker1084 is offline   Reply With Quote
Old 12-05-2012, 07:07 AM   PM User | #5
misteroram01
New Coder

 
Join Date: Sep 2012
Posts: 13
Thanks: 0
Thanked 2 Times in 2 Posts
misteroram01 is an unknown quantity at this point
The Restful Objects specification defines a set of RESTful resources, and corresponding JSON representations, for accessing and manipulating a domain object model.
misteroram01 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:21 AM.


Advertisement
Log in to turn off these ads.