This is a question about the REST API!

Asked 2 years ago, Updated 2 years ago, 55 views

Hello! While studying about REST API, I have a question, so I ask you a question!

In services where REST APIs are well designed and implemented

www.example.com/members/1 If I type this in the address bar of the web browser and press Enter, is this definitely the GET method?

The reason why I was curious about this at first is that the REST API is stateless and the server does not store the client's status information (not using a session). Then I was curious about how to check the authority according to the user's classification, so I even reached those questions.

REST API is

GET /members/1

POST /members/1

PUT /members/1

DELETE /members/1

As shown above, tasks such as inquiry/input/modification/deletion can be processed at the same URL (classification according to the method) I think it would be a problem if the server could not check the status of the client (authorization, etc.) and input and send the method from the web browser address bar!

rest

2022-09-22 21:09

1 Answers

In the web browser window, type http://www.example.com/members/1 to request with the default value GET.

For other requests, there are many ways to use the html form tag or the http-related library.

The feature of the REST API is that you only need to respond to incoming requests without having to do anything else. It's easy to focus on business jobs because you don't have to maintain the client's context (such as user information) from the server. Client permission checks are typically handled by the authentication server.

예를 들어 A업체 REST API 를 이용할 경우에

Company A issues the REST API key.

The client requests the authentication server of Company A to REST API KEY and receives ACCESS TOKEN.

The client obtains its resources from the REST API server using ACCESS TOKEN.

Outh reference

Security and certification reference


2022-09-22 21:09

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.