Discussion on RESTful APIs ?
I'm under the impression right now a REST api is essentially using HTTP to retrieve information from a server via JSON responses.
This confuses me because when I used Paypal's SDK which says REST in the title...I didn't use any JSON to build the script.
bump
>>56119314
As far as I understand it OP thats pretty much what REST is.
Technically it comes with all this extra bullshit for example not having any state and using all the HTML request things instead of just POST/GET all the time or whatever. But in practice thats a load of fuck. Good luck with sessions when you're not using any state. And nobody uses anything other than POST and GET so shove your fucking PUT, DELETE etc up your ass.
>>56119577
haha. thanks for the validation anon.
if only we can clear up the Paypal confusion now...
The only conclusion I've come to is it is passing variables threw the URL but I don't think that would be classified as REST since it's not JSON...
Unless REST is not limited to JSON.
>>56119652
GET passes stuff through the URL and is used to get something from the server i.e get me all the data on the nigger with uuid xxx-333-yyy etc and the uuid would be in the URL. That uuid would be accessed as the querystring from the server. I think you could use JSONs in this manner but its a horrible idea.
POST is for sending JSONs. Use JSON.stringify(fuckingObject) when sending data in a POST.
REST advocates using GET/POST how they were originally intended i.e. to get something and to send something. Both are restful, it dosent have to be JSON. You could use a POST request to send nigger uuid and get the data attached to it but that wouldn't be strictly restful.
>>56119769
dam. That even clears up my confusion with what "RESTful" is. Much appreciated.
No, ReST is a way of structuring routes/resources. Unrelated to JSON. It's just most services today will use JSON vice XML.
http://restfulrouting.com/#introduction
It's a way of breaking resource requests into their CRUD (create read update destroy) categories.
Most important idea is this:
INDEX GET
SHOW GET
CREATE POST
NEW GET
EDIT GET
UPDATE PUT
DESTROY DELETE
>>56119314
rest just means putting all of the state in the addressbar. json has nothing to do with it
REST is a few different principles. REST doesn't say anything about using JSON (you can use XML or protobufs if you want).
REST is about using HTTP verbs (GET, POST, PUT, DELETE) to interact with data.
REST is about GET /users/ getting all the users, and GET /users/1 getting the first user.
REST is about using "DELETE /users/1" instead of "GET /users/1/delete".
StackOverflow is a better place for questions like this:
http://stackoverflow.com/questions/671118/what-exactly-is-restful-programming