Skip to content

Commit 91ab33f

Browse files
updated readme
1 parent c7672e7 commit 91ab33f

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 with houses. You can GET/POST/PUT/PATCH and DELETE them.
5+
This repository contains a controller which is dealing with FoodItems. 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 single house
23+
## GET single food
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 a house
29+
## POST a foodItem
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)