You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix First Min Web API: missing ID in request body (#34956) (#34959)
Also address a few more minor things in the article:
- MD040 - Fenced code blocks should have a language specified
- Make the casing of HTTP verbs in consistent with the text
Copy file name to clipboardExpand all lines: aspnetcore/tutorials/min-web-api.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,10 +244,10 @@ The POST endpoint will be used to add data to the app.
244
244
245
245
A new file is created in the project folder named `TodoApi.http`, with contents similar to the following example:
246
246
247
-
```
247
+
```http
248
248
@TodoApi_HostAddress = https://localhost:7031
249
249
250
-
Post {{TodoApi_HostAddress}}/todoitems
250
+
POST {{TodoApi_HostAddress}}/todoitems
251
251
252
252
###
253
253
```
@@ -269,10 +269,10 @@ The POST endpoint will be used to add data to the app.
269
269
270
270
The preceding code adds a Content-Type header and a JSON request body. The TodoApi.http file should now look like the following example, but with your port number:
271
271
272
-
```
272
+
```http
273
273
@TodoApi_HostAddress = https://localhost:7057
274
274
275
-
Post {{TodoApi_HostAddress}}/todoitems
275
+
POST {{TodoApi_HostAddress}}/todoitems
276
276
Content-Type: application/json
277
277
278
278
{
@@ -349,8 +349,8 @@ Test the app by calling the `GET` endpoints from a browser or by using **Endpoin
349
349
350
350
The following content is added to the `TodoApi.http` file:
351
351
352
-
```
353
-
Get {{TodoApi_HostAddress}}/todoitems
352
+
```http
353
+
GET {{TodoApi_HostAddress}}/todoitems
354
354
355
355
###
356
356
```
@@ -374,7 +374,7 @@ Test the app by calling the `GET` endpoints from a browser or by using **Endpoin
374
374
* In **Endpoints Explorer**, right-click the `/todoitems/{id}`**GET** endpoint and select **Generate request**.
375
375
The following content is added to the `TodoApi.http` file:
376
376
377
-
```
377
+
```http
378
378
GET {{TodoApi_HostAddress}}/todoitems/{id}
379
379
380
380
###
@@ -465,8 +465,8 @@ Update the to-do item that has `Id = 1` and set its name to `"feed fish"`.
465
465
466
466
The following content is added to the `TodoApi.http` file:
467
467
468
-
```
469
-
Put {{TodoApi_HostAddress}}/todoitems/{id}
468
+
```http
469
+
PUT {{TodoApi_HostAddress}}/todoitems/{id}
470
470
471
471
###
472
472
```
@@ -475,10 +475,11 @@ Update the to-do item that has `Id = 1` and set its name to `"feed fish"`.
475
475
476
476
* Add the following lines immediately after the PUT request line:
477
477
478
-
```
478
+
```http
479
479
Content-Type: application/json
480
480
481
481
{
482
+
"id": 1,
482
483
"name": "feed fish",
483
484
"isComplete": false
484
485
}
@@ -502,6 +503,7 @@ Use Swagger to send a PUT request:
502
503
503
504
```json
504
505
{
506
+
"id": 1,
505
507
"name": "feed fish",
506
508
"isComplete": false
507
509
}
@@ -525,7 +527,7 @@ The sample app implements a single DELETE endpoint using `MapDelete`:
525
527
526
528
* Replace `{id}` in the DELETE request line with `1`. The DELETE request should look like the following example:
0 commit comments