Today hundreds of companies use REST APIs to create web services. It's the most logical, efficient and widespread standard. So in this article we will take a deep look into it.
Overview
API
It stands for Application Programming Interface, a software intermediary that allows two apps to talk to each other.
Types by use Cases
APIs
It can be classified according to the systems for which they are designed.
Here are they :
- Databases
- Operating Systems
- Remote
- Web
What is it then?
RESTful API
It is an architectural style and approach to communications often used in web service development.
Architectural Constraints
There are 6 architectural constraints that make any web service. The only optional constraint is the last one:
- Uniform Interface
- Stateless -Cacheable
- Client-Server
- Layered System
- Code on Demand (optional)
Why REST?
- Client and server are separated
- Visibility, readability and scalability
- Independent of platforms and languages
How it works?
RESTful API uses existing HTTP method, providing a meaning for the request you're making, to obtain resources from the server:
- GET - To retrieve a resource
- PUT - To update a resource
- POST - To create a new resource
Format
JSON - JavaScript Object Notation is a common format to send and request data through REST APIs. It's object looks like:
/* Each property and value must be wrapped with double quotation marks */
{
"property1": "value1",
"property2": "value2",
"property3": "value3"
}
Thanks For Reading
Previously at -> Emma's Blog
Top comments (5)
I understand nothing, ABSOLUTELY NOTHING, by reading this.
What do you think was the issue?
Very verbose and never getting to the point at all. This is meant to be a beginners guide to
rest api
, well I'm a beginner torest
, I didn't read na-da aboutrest
here.P.S. a lot of the sentences used in this seems like they are copy pasted from some documentation
Assuming you have read on rest and you are comfortable with the concept, would you make any suggestions on improving this post?
she just put a bl here