Default of HTTP request

Asked

Viewed 38 times

0

I am developing a restfull API.

I have this route: /senha

In the POST I saved the password;

In the PUT i update the password;

In the DELETE i delete the password;

In the GET I call the password;

Only by using the GET besides calling, I update a field modifying the status of the same.

Only I need another method to be able to call the password again, but this time without updating the status.

What would be the HTTP method best suited for this?

2 answers

0

From what I understand you apart from fetching the data is updating a field in the backend, is this or got it wrong ? if this is the case you can use the PATCH method that is used in cases where a partial update of the data is made, differing from the put where is sent to update the whole object, in the patch is sent only the data that will be modified.

0

In your case, use another route/request GET. Note that the technical description of each verb makes its functions clear, and taking this into account, the GET is the type of call to be used when the need only involves requesting and retrieving data without requiring the server to receive any data or client configuration, as is your case, since there will be no status update and no data sending, only the "rejected".

More details about GET and other http verbs and good usage practices this link from W3 Schools

Browser other questions tagged

You are not signed in. Login or sign up in order to post.