c # – Correct use of HTTP VERBS in the custom REST implementation

I have a server-side service (with ASP.NET Core) that should provide a REST API for different clients.

Behind the service I use a SQL server for data storage.

The controller has the following route attribute:

[Route("api/[controller]")]
[ApiController]
public class CustomDataController: ControllerBase
{...}

There are data provider methods:

[HttpGet(nameof(GetDataForGuest))]



public async task <IQueryable> GetDataForGuest (int skip, int take, Guid Organization ID) => expects DataProvider.GetDataAsync(skip, take, organizationID);

There are methods for creating or updating data on the server:

[HttpPost(nameof(SaveDataToServer))]



public async Task SaveDataToServer ([FromBody] list specs) => waits for dataProvider.SaveDataAsync(specs, isNewData: true);

According to many articles (like this one), RECEIVE is for the return of a resource, POST OFFICE is to create and PUT is for the update:

  • GET – For the return of resources
  • POST – to create a new resource
  • PUT – to update a resource
  • PATCH – to update a resource
  • DELETE – to delete a resource

However, as you can see, my methods are just facades. The data is stored by the data provider. I can decide whether to insert or update an incoming record based on a bool variable.

As you can imagine, I do not use traditional REST URLs (like API / user / 1), because I need complex data, my URLs look like this:

https://192.168.0.101:8080/api/customdata/GetDataForGuest?skip=0&take=10&organizationID=58b77372-abbc-435e-9a5b-d77bc05129c7

Currently I get data with the HttpPost both to insert new records and to update existing records (and it works normally). My concerns relate to best practices: Should I use? HttpPut If I want to update an existing record?
Use according to the specifications PUT is idempontent by definition during POST OFFICE is not.

So just use it POST OFFICE is considered good practice? Or should I split the update actions to another, with marked method HttpPut? Is it important to keep in mind that the logic behind the methods decides what happens and not the verb?