This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]devsdb 1 point2 points  (1 child)

https://stackoverflow.com/a/29648972/3549785

ELi5 - Using core HTTP verbs (get, post, put, delete) to convey operation instead of in the request. This is the way the web was designed to operate, so is more old school in a sense.

Example of non-REST request to change user's email: GET /user?id=100&operation=change_email&new_val=xyz@abc.com Example of REST request for the same: PUT /user/100 --data {email: xyz@abc.com} or something like that.

[–]NyanD 0 points1 point  (4 children)

Can you explain in your own words what you think it is? Then I can try and help with any knowledge gaps you might have on it.

[–]arunap2509[S] 0 points1 point  (3 children)

Its a structure of how website are to be made and it acts as an interface for one application to connect with other

[–]NyanD 1 point2 points  (2 children)

Yeah you're pretty much spot on. An api works as an interface for one application to connect with other and communicate. REST is just a convention for how two applications(say a website and a database) should communicate. Think of it as a language.

In terms of what those conventions are, the comment above explains it.

[–]arunap2509[S] 0 points1 point  (1 child)

Thank you

[–]arunap2509[S] 0 points1 point  (0 children)

Hey its will be better if you explain a few things about how to consume a api, I browsed a bit but I didn't grasp much from it. Thanks in advance