Posts · 8 November 2026 · 5 min read · 39 reads

GET, POST, PUT, DELETE: Choosing HTTP Verbs in a Real .NET Core API

How I choose HTTP verbs in an ASP.NET Core Web API through a real workflow such as leave requests, not just textbook definitions.

Mapping in the books

Most sources describe HTTP verbs with the same short table: GET reads, POST creates, PUT updates, DELETE removes. This summary is not wrong, but it does not explain the practical side of the work. In real enterprise APIs these rules are often stretched, and understanding why is much more useful than memorizing the definitions.

In this post I look at a scenario that comes from HR and payroll: submitting, updating and cancelling leave requests. At each step I try to show which verb I chose and why, and where the choice departs from the textbook.

Why the rules stretch in the real world

HTTP verbs are a contract. Properties such as being safe and idempotent are assumed and relied upon by intermediaries, caches, retry logic and client libraries. So when we pick a verb, other components that depend on its behavior come into play.

Business rules, however, do not always fit CRUD. Does "approve the leave request" create a record, change the state of a record, or trigger a process? The answer depends on the scenario. That is why verb selection should be based on the nature of the resource and its business meaning.

The leave request scenario

When an employee creates a leave request, the record lives in the system as a new resource. Its status changes until the request is approved, rejected or withdrawn by the employee. The payroll system also reads these records on specific dates. So a single leave request involves several different operations, and each may call for a different verb or a different resource representation.

For read operations, GET is the obvious choice. When we only list the employee's own requests or a manager's team requests, nothing changes on the server side, and the client can retry as many times as it wants.

Submitting: when POST is right and when it is not

POST is appropriate for submitting a new leave request. The server creates the record, assigns its identifier itself, and returns the address of the new resource in the response. The important point here is that sending the same request twice can produce two records. To prevent this, a good approach is to send an idempotency key from the client or to check for duplicate requests on the server.

Business actions such as approving or rejecting are more debatable. Modeling them as sub-resource actions like POST /leave-requests/{id}/approve is often more readable, because it makes state transitions explicit. Strict REST purists may object, but as long as the team has a clear agreement, this flexibility does not cause problems.

Updating: PUT or PATCH

To change the dates or the description of a request, we have to choose between PUT and PATCH. PUT is a model in which we send the whole resource, and it is idempotent. PATCH is used for partial updates in which we send only the fields that change.

In a leave request, often only the start and end dates change. In that case PATCH carries less data and prevents other fields from being overwritten by accident. However, whether PATCH is idempotent can vary between implementations, so it needs to be documented.

[HttpPatch("{id:guid}")]
public async Task<IActionResult> Update(Guid id, LeaveRequestPatch patch)
{
    var request = await _repo.FindAsync(id);
    if (request is null) return NotFound();
    if (request.Status != LeaveStatus.Pending)
        return Conflict("Onaylanmış talepler değiştirilemez.");

    patch.ApplyTo(request);
    await _repo.SaveAsync();
    return NoContent();
}

What matters in this example is that the business rule does not break the verb choice. An approved request cannot be changed, and this is reported with 409 Conflict.

Deleting: really deleting or cancelling

The DELETE verb sounds simple, but for leave requests it is rarely the right behavior. Payroll calculations depend on historical records, and audit trails must not be deleted. That is why we usually change the request's status to "cancelled" instead of physically deleting it.

Even so, a DELETE call can still make sense from the client's perspective. The server receives the request, cancels the record and returns 204 No Content. What matters is the promise made to the outside world: the resource no longer appears in the active list, but it may still exist in the database. This distinction should be stated clearly in the API documentation.

Highlights

  • GET should always be the first choice for read operations that have no side effects.
  • POST creates a new resource; consider an idempotency key against repeated submissions.
  • For business actions (approval, rejection), sub-resource actions make state transitions more explicit.
  • PATCH can be a safer option than PUT for partial updates.
  • Where audit and historical data are required, DELETE often becomes cancellation or a status change.
  • Every verb choice should be documented together with the expectations of clients and intermediaries.

When to use it

Verb selection should be done by thinking about the resource's lifecycle and business rules, not by looking up a textbook table. GET for reading, POST for new records, PATCH for partial changes, PUT for full representation replacement, and a status change instead of deletion for fields that require cancellation: in most enterprise scenarios, this is a reasonable starting point. When you define a consistent set of rules as a team and document them, departing from the textbook stops being a problem.

Read the original article on DZone ↗

Comments (0)

No comments yet; be the first.

Leave a comment

Comments are published after approval.