HTTP request request

0

I'm developing a restFull API.

I have this route: /senha

No POST I save the password;

No PUT I update the password;

No DELETE I delete the password;

No GET I call the password;

But when I use GET in addition to calling, I update a field by modifying status of it.

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

What would be the HTTP method most appropriate for this?

    
asked by anonymous 11.10.2018 / 18:15

2 answers

0

For your case, use another route / request GET . Note that the technical description of each of the verbs makes its functions clear, and taking that into account, GET is the type of call to be used when the need involves only the request and the obtaining of data without specifying that the server receives some data or configuration of the client, as it is your case, since there will be a status update and no data sending, just the "callback".

More details on GET and other http verbs and good practice in this w3 Schools link

    
11.10.2018 / 18:29
0

As I understand you, besides searching for the data you are updating a field in the backend, is this or did I misunderstand? 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 it is sent to update the object completely, in the patch it sends only the data that will be modified .

    
11.10.2018 / 21:23