-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstAPI.http
More file actions
84 lines (59 loc) · 1.31 KB
/
FirstAPI.http
File metadata and controls
84 lines (59 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@FirstAPI_HostAddress = http://localhost:5000
@rootURL = http://localhost:5000
// http://localhost:5000/WeatherForecast
GET {{FirstAPI_HostAddress}}/weatherforecast/
Accept: application/json
###
GET {{rootURL}}/api/books
Accept: application/json
// To get all books
###
GET {{rootURL}}/api/books/2
Accept: application/json
// To get a specific book by ID
###
POST {{rootURL}}/api/books
Content-Type: application/json
// TO add a new book with Details except Id.
{
"Title": "Mediation",
"Author": "Marcus",
"YearPublished": 2015
}
###
POST {{rootURL}}/api/books
Content-Type: application/json
{
"Title": "Man's Search for Meaning",
"Author": "Viktor Frankl",
"YearPublished": 1946
}
###
PUT {{rootURL}}/api/books/7
Content-Type: application/json
// To update a specific book by ID
{
"Id":7,
"Title": "7 Habits of Highly Effective People",
"Author": "Stephen R. Convey",
"YearPublished": 1989
}
###
DELETE {{rootURL}}/api/books/8
// To Delete a specific book by ID
###
POST {{rootURL}}/api/books
Content-Type: application/json
{
"Title": "Bhagvat Gita",
"Author": "Ved Vyasa",
"YearPublished": 400
}
###
POST {{rootURL}}/api/books
Content-Type: application/json
{
"Title": "7 Habits of Highly Affective People",
"Author": "Stephen R. Convey",
"YearPublished": 1989
}