0% found this document useful (0 votes)
19 views13 pages

REST API Basics and Best Practices

REST (REpresentational State Transfer) is an architectural style for developing web services that builds upon existing HTTP features rather than creating new standards. In a REST architecture, all resources should support common HTTP operations like GET, POST, PUT, DELETE and resources can be in various formats like text, XML, JSON. REST is used for distributed systems as requests can be directed to any component instance.

Uploaded by

sticea ciprian
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views13 pages

REST API Basics and Best Practices

REST (REpresentational State Transfer) is an architectural style for developing web services that builds upon existing HTTP features rather than creating new standards. In a REST architecture, all resources should support common HTTP operations like GET, POST, PUT, DELETE and resources can be in various formats like text, XML, JSON. REST is used for distributed systems as requests can be directed to any component instance.

Uploaded by

sticea ciprian
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like