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

I have a server side service (using ASP.NET Core) that should provide a REST API to several 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 asynchronous task <IQueryable> GetDataForGuest (int skip, int take, Guid organizationID) => awaits dataProvider.GetDataAsync(jump, take, organization ID);

There are methods to create or update data on the server:

[HttpPost(nameof(SaveDataToServer))]



Asynchronous public task SaveDataToServer ([FromBody] List specifications) => awaits dataProvider.SaveDataAsync(specifications, isNewData: true);

According to many articles (like this one), OBTAIN is to return some resource, SUBMIT is to create and PUT is to update:

  • GET – To return 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 only facades, the data is saved by the data provider and I can decide on the basis of a bool variable to insert or update an incoming record.

As you can also guess, I do not use traditional REST URLs (like api / user / 1), since I need complex data, so my URLs look like this:

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

I currently obtain data with the HttpPost both to insert new records and to update existing ones (and it works normally). My concerns are about best practices: Should I use HttpPut When do I want to update an existing record?
According to the specifications, using PUT is identity content by definition while SUBMIT It is not.

Just using SUBMIT Is it considered as the best practice? Or I must separate the update actions to another method marked with HttpPut? Does it matter considering that the logic behind the methods decides what will happen and not the verb?