Software Engineering Asked by programer on February 5, 2021
I recently started learning about REST APIs and I am trying to understand how they work and what they are used for. From what I have read so far and from what I understand, a REST API can be used as a back-end for multiple different applications at the same time, android applications, web applications etc. Is that the main use of a REST API or is it just something it provides but not the main reason to use it. Or am I completely wrong?
Edit: I didn’t want to add more questions here so I created a new relative question:
API vs REST API
if you can go check it out I would really appreciate it.
Also thank you for taking the time to answer me.
REST is an API architecture pattern; REST APIs are distinguished from other APIs by their design. They offer a standardized interface for interacting with data resources. A REST API for a financial institution would be structured similarly to one for a hospital system; different problem spaces, but similar API design.
Any REST or non-REST API can be used by multiple applications, so it's not safe to say that REST APIs are more reusable than non-REST APIs. REST is simply a common standard for implementing data access/manipulation operations through an API.
For example, if I had a web API that managed foo
objects, I might have the following HTTP endpoints for a RESTful API:
GET /foo/<id> # Look up a foo
POST /foo # Create a new foo
Or, if not following REST guidelines, I may have:
GET /foo?id=<id> # Look up a foo
POST /newFoo # Create a new foo
The latter API is technically just as reusable as the former, but the former is more standardized and will be more recognizable by developers who have used REST before.
To learn more about the standards/guidelines of REST, see Representational State Transfer.
Answered by Kyle McVay on February 5, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP