I have a question about RESTful

Asked 2 years ago, Updated 2 years ago, 122 views

Currently, many web developments are being developed in the form of RESTful API, and I think it would be a great study if you could tell me exactly what RESTful is.

I understand that the network-based architecture mentioned in Dr. Roy Fielding's paper, which determined that the existing form of the web was not using the efficiency of the web, is RESTful, and that it should not be divided into CRUDs through URIs, but it should work through HTTP methods. I'm asking you this question because I think you understand something uncomfortable.

Can anyone explain exactly what RESTful is?

restful web

2022-09-21 23:10

1 Answers

To sum up, you're right to understand.

Before the RESTful web was proposed, web and web services were implemented only by GET, POST among the proposed basic methods (GET, PUT, POST, DELETE, HEAD, OPTIONS, ...) in the HTTP specification. Of course, there was a security reason behind this..

I understand that RESTful's proposer suggested that the web and web services being developed do not conform to the requirements of the URL and do not use the HTTP method already established.

I used GET, POST to create (CREATE), find (RETREVE), modify (UPDATE) some resources on the server. This was usually expressed in URLs in the following styles:

POST /create/some/resource
GET /find/some/resourceid
GET /search/some/keywords
POST /update/some/resource
GET /delete/some/resourceid

A URL refers to the location (a kind of electronic address) of a resource that exists on the Internet.

According to the previous method, resources have different URLs in the cycle of creation-search-modification-deletion. It's the same resource, but it's different when you search and it's different when you modify it. Even in the case of bulletin boards at this time, it was common for all posts to have the same url, and only the parameters of url to take different forms.

The essence of RESTful is to use it as the original concept of the URL, and to use CRUD for resources on the web as the corresponding HTTP method (Create=>PUT, Retrieve=>GET, Update=>POST, Delete=>DELETE).

The methodology is to use HTTP and URL properly, but the argument itself is easy to accept, it is more intuitive than the existing method, and I think it has become widespread because it is not much different in terms of development difficulty. Also, unlike early HTTP, HTTPS and various web authentication methods have solved the security part to some extent, so I think it was easily accepted by people.


2022-09-21 23:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.