Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91ab33f

Browse files
updated readme
1 parentc7672e7 commit91ab33f

File tree

8 files changed

+26
-19
lines changed

8 files changed

+26
-19
lines changed

‎.github/delete.jpg‎

406 KB
Loading

‎.github/get.jpg‎

485 KB
Loading

‎.github/getSingle.jpg‎

495 KB
Loading

‎.github/patch.jpg‎

455 KB
Loading

‎.github/post.jpg‎

421 KB
Loading

‎.github/put.jpg‎

426 KB
Loading

‎.github/versions.jpg‎

365 KB
Loading

‎Readme.md‎

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,56 @@
1-
#ASP.NET Core WebApi Sample
1+
#ASP.NET Core WebApi Sample with HATEOAS, Versioning & Swagger
22

33
In this repository I want to give a plain starting point at how to build a WebAPI with ASP.NET Core.
44

5-
This repository contains a controller which is dealing withhouses. You can GET/POST/PUT/PATCH and DELETE them.
5+
This repository contains a controller which is dealing withFoodItems. You can GET/POST/PUT/PATCH and DELETE them.
66

77
Hope this helps.
88

99
See the examples here:
1010

11-
##GET all houses
11+
##Versions
1212

13-
``` http://localhost:29435/api/house```
13+
``` http://localhost:29435/swagger```
14+
15+
![ASPNETCOREWebAPIVersions](./.github/versions.jpg)
16+
17+
##GET all Foods
18+
19+
``` http://localhost:29435/api/v1/foods```
1420

1521
![ASPNETCOREWebAPIGET](./.github/get.jpg)
1622

17-
##GET singlehouse
23+
##GET singlefood
1824

19-
``` http://localhost:29435/api/house/1```
25+
``` http://localhost:29435/api/v1/foods/2```
2026

2127
![ASPNETCOREWebAPIGET](./.github/getSingle.jpg)
2228

23-
##POST ahouse
29+
##POST afoodItem
2430

25-
``` http://localhost:29435/api/house```
31+
``` http://localhost:29435/api/v1/foods```
2632

2733
```javascript
2834
{
29-
"street":"MyNewStreet",
30-
"city":"MyHomeTown",
31-
"zipCode":1234
35+
"name":"Lasagne",
36+
"type":"Main",
37+
"calories":3000,
38+
"created":"2017-09-16T17:50:08.1510899+02:00"
3239
}
3340
```
3441

3542
![ASPNETCOREWebAPIGET](./.github/post.jpg)
3643

3744
##PUT a house
3845

39-
``` http://localhost:29435/api/house/5```
46+
``` http://localhost:29435/api/v1/foods/5```
4047

4148
```javascript
4249
{
43-
"id":5,
44-
"street":"HAAALELUJAH",
45-
"city":"HAAALELUJAH-TOWN",
46-
"zipCode":1234657
50+
"name":"Lasagne2",
51+
"type":"Main",
52+
"calories":3000,
53+
"created":"2017-09-16T17:50:08.1510899+02:00"
4754
}
4855
```
4956

@@ -52,19 +59,19 @@ See the examples here:
5259

5360
##PATCH a house
5461

55-
``` http://localhost:29435/api/house/4```
62+
``` http://localhost:29435/api/v1/foods/5```
5663

5764
```javascript
5865
[
59-
{"op":"replace","path":"/street","value":"PatchStreet" }
66+
{"op":"replace","path":"/name","value":"mynewname" }
6067
]
6168
```
6269

6370
![ASPNETCOREWebAPIGET](./.github/patch.jpg)
6471

6572
##DELETE a house
6673

67-
``` http://localhost:29435/api/house```
74+
``` http://localhost:29435/api/v1/foods/5```
6875

6976

7077
![ASPNETCOREWebAPIGET](./.github/delete.jpg)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp