Skip to content

Commit f0bec11

Browse files
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
1 parent e17ce65 commit f0bec11

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

aspnetcore/tutorials/min-web-api.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,10 @@ The POST endpoint will be used to add data to the app.
244244

245245
A new file is created in the project folder named `TodoApi.http`, with contents similar to the following example:
246246

247-
```
247+
```http
248248
@TodoApi_HostAddress = https://localhost:7031
249249
250-
Post {{TodoApi_HostAddress}}/todoitems
250+
POST {{TodoApi_HostAddress}}/todoitems
251251
252252
###
253253
```
@@ -269,10 +269,10 @@ The POST endpoint will be used to add data to the app.
269269

270270
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:
271271

272-
```
272+
```http
273273
@TodoApi_HostAddress = https://localhost:7057
274274
275-
Post {{TodoApi_HostAddress}}/todoitems
275+
POST {{TodoApi_HostAddress}}/todoitems
276276
Content-Type: application/json
277277
278278
{
@@ -349,8 +349,8 @@ Test the app by calling the `GET` endpoints from a browser or by using **Endpoin
349349

350350
The following content is added to the `TodoApi.http` file:
351351

352-
```
353-
Get {{TodoApi_HostAddress}}/todoitems
352+
```http
353+
GET {{TodoApi_HostAddress}}/todoitems
354354
355355
###
356356
```
@@ -374,7 +374,7 @@ Test the app by calling the `GET` endpoints from a browser or by using **Endpoin
374374
* In **Endpoints Explorer**, right-click the `/todoitems/{id}` **GET** endpoint and select **Generate request**.
375375
The following content is added to the `TodoApi.http` file:
376376

377-
```
377+
```http
378378
GET {{TodoApi_HostAddress}}/todoitems/{id}
379379
380380
###
@@ -465,8 +465,8 @@ Update the to-do item that has `Id = 1` and set its name to `"feed fish"`.
465465

466466
The following content is added to the `TodoApi.http` file:
467467

468-
```
469-
Put {{TodoApi_HostAddress}}/todoitems/{id}
468+
```http
469+
PUT {{TodoApi_HostAddress}}/todoitems/{id}
470470
471471
###
472472
```
@@ -475,10 +475,11 @@ Update the to-do item that has `Id = 1` and set its name to `"feed fish"`.
475475

476476
* Add the following lines immediately after the PUT request line:
477477

478-
```
478+
```http
479479
Content-Type: application/json
480480
481481
{
482+
"id": 1,
482483
"name": "feed fish",
483484
"isComplete": false
484485
}
@@ -502,6 +503,7 @@ Use Swagger to send a PUT request:
502503

503504
```json
504505
{
506+
"id": 1,
505507
"name": "feed fish",
506508
"isComplete": false
507509
}
@@ -525,7 +527,7 @@ The sample app implements a single DELETE endpoint using `MapDelete`:
525527

526528
* Replace `{id}` in the DELETE request line with `1`. The DELETE request should look like the following example:
527529

528-
```
530+
```http
529531
DELETE {{TodoApi_HostAddress}}/todoitems/1
530532
531533
###

0 commit comments

Comments
 (0)