What is
Rest api?
Ankit Pangasa Swipe for More
ReST
REpresentational
State
Transfer
Swipe for More Ankit Pangasa
Wow! I didn't get
anything
REpresentational ?
State ?
Transfer ?
Ankit Pangasa Swipe for More
REST is an architectural style for
developing web services. REST is popular
due to its simplicity and the fact that it
builds upon existing systems and features
of the internet's Hypertext Transfer
Protocol (HTTP) in order to achieve its
objectives, as opposed to creating new
standards, frameworks and technologies.
Swipe for More Ankit Pangasa
In a REST based architecture everything is
a Resource. Every resource should support
the HTTP common operations. REST
resources can be text, XML, JSON etc.
REST is used heavily in distributed system
because any request can be directed to
any instance of a component.
Swipe for More Ankit Pangasa
What are the
different methods
supported by
Rest?
Swipe for More Ankit Pangasa
Swipe for More Ankit Pangasa
What are the
numerical return
values in Rest
apis?
Swipe for More Ankit Pangasa
Swipe for More Ankit Pangasa
Any tips for writing
good REST apis?
Ankit Pangasa Swipe for More
Don't use verbs, use nouns in the api. Like
use "/users" and not "/getAllCars"
Do not mix up singular and plural nouns. Keep it simple and
use only plural nouns for all resources.
Use PUT, POST and DELETE to alter the resource and GET
method to get the resource
Use sub-resources for relation. To get all books in library
with Id 2, use GET /library/2/books/
Impose API Version and do not release
an unversioned API.
Swipe for More Ankit Pangasa
Thank you
It was really helpful. Now I can sleep
peacefully
Ankit Pangasa Swipe for More
Enjoyed The
Content?
If this post is useful for you,
please like, repost, comment and save.
Keep following Ankit Pangasa for more
such useful content