ASP.NET can't send PATCH request via Visual Studio 2025
05:09 05 Oct 2026

I'm stuck on Test the PATCH endpoint" endpoint after successfully sending a POST request.

I'm getting an error http 405 method not found.

ToDoAPI:

###Patch request | Debug
PATCH {{TodoApi_HostAddress}}/todoitems/1
Content-Type: application/json
  {
    "name": "run errands"
  }

Program.cs:

app.MapPatch("/todoitems/{id}", async (int id, TodoPatchDto inputTodo, TodoDb db) =>
{
    var todo = await db.Todos.FindAsync(id);

    if (todo is null) 
        return Results.NotFound();

    if (inputTodo.Name is not null) 
       todo.Name = inputTodo.Name;

    if (inputTodo.IsComplete is not null) 
       todo.IsComplete = inputTodo.IsComplete.Value;

    await db.SaveChangesAsync();

    return Results.NoContent();
});

I've tried these solutions:

  1. Moved the ### so it sits before the POST/PATCH line (marking the start of a new request), not between the request line and its Content-Type header.

  2. Fixed it → generic "error sending request" (cert/port issue).

  3. Fixed cert/port → 400, body wasn't attaching (same ### issue, different spot).

  4. Fixed that → generic error again, port mismatch (7031 vs 7071).

  5. Sent PATCH → 404. No PATCH route existed, only GET/POST/PUT/DELETE.

  6. Used Endpoints Explorer "Generate request" for PATCH.

  7. Still 404. Last step: confirm MapPatch is actually in Program.cs and the app was rebuilt after adding it — unconfirmed, left open there.

Any suggestions?

c# asp.net-core http-patch