-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.http
More file actions
66 lines (55 loc) · 1.85 KB
/
post.http
File metadata and controls
66 lines (55 loc) · 1.85 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
### Get all posts
GET localhost:8080/api/
### Get post by id
GET http://localhost:8080/api/post-1
### Get an invalid post by id
GET http://localhost:8080/api/post-99
### Create a new post
POST http://localhost:8080/api/
Content-Type: application/json
{
"id": 2,
"title": "Post N°2 !",
"subheading": "The subheading is a masterpiece",
"slug": "slug-post-2",
"dateCreated": "2026-02-24T20:18:00",
"dateUpdated": null,
"category": "Technology",
"author": "Kafui Homevo",
"content": "## Look, you're great ! \n### This is your gift \nYou know you deserve and are capable of more than that. I believe in you !",
"imageUrl": "https://example.com/image2.jpg"
}
### Updating post 2
PUT http://localhost:8080/api/post-2
Content-Type: application/json
{
"id": 2,
"title": "Post N°2 ! ---- Updated !",
"subheading": "(Updated) The subheading is a masterpiece",
"slug": "slug-post-2",
"category": "Science",
"dateCreated": "2026-02-26T22:10:00",
"dateUpdated": null,
"author": "Kafui Homevo",
"content": "## Look, you're great ! \n### This is your gift \nYou know you deserve and are capable of more than that. I believe in you !",
"imageUrl": "https://example.com/image2_updated.jpg"
}
### Updating unexisting post
PUT http://localhost:8080/api/post-99
Content-Type: application/json
{
"id": 99,
"title": "Post N°99 ! ---- Updated !",
"subheading": "(Updated) The subheading is a masterpiece",
"slug": "slug-post-2",
"category": "Science",
"dateCreated": "2026-02-26T22:10:00",
"dateUpdated": null,
"author": "Kafui Homevo",
"content": "## Look, you're great ! \n### This is your gift \nYou know you deserve and are capable of more than that. I believe in you !",
"imageUrl": "https://example.com/image99.jpg"
}
### Delete post 2
DELETE localhost:8080/api/post-2
### Delete unexisting post
DELETE http://localhost:8080/api/post-99