If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

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?

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 carshttp://host/cars/1 - when you do a GET on this URL, you are tring to get a car that has the ID of 1http://host/cars/1 - when you do a PUT on this URL, it means you are trying to update the car with the ID of 1http://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.

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

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.