forked from keploy/samples-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.txt
More file actions
44 lines (23 loc) · 1.29 KB
/
Copy pathapi.txt
File metadata and controls
44 lines (23 loc) · 1.29 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
---------------------------------------------------------------------------------------------------
// Add a Book
curl -X POST http://localhost:5000/books/ \
-H "Content-Type: application/json" \
-d '{"title": "1984", "author": "George Orwell"}'
---------------------------------------------------------------------------------------------------
// Get All Books(with Pagination)
curl -X GET "http://localhost:5000/books/?page=1&limit=10"
---------------------------------------------------------------------------------------------------
// Get Book Details
curl -X GET http://localhost:5000/books/1
---------------------------------------------------------------------------------------------------
//Search Books by Title
curl -X GET "http://localhost:5000/books/search?query=1984"
---------------------------------------------------------------------------------------------------
//Update a Book
curl -X PUT http://localhost:5000/books/1 \
-H "Content-Type: application/json" \
-d '{"title": "1984 - Updated", "author": "George Orwell"}'
---------------------------------------------------------------------------------------------------
//Delete a Book
curl -X DELETE http://localhost:5000/books/1
---------------------------------------------------------------------------------------------------