-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.http
More file actions
56 lines (44 loc) · 1.04 KB
/
test.http
File metadata and controls
56 lines (44 loc) · 1.04 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
### New Post
POST http://localhost:8080/api/posts
Content-Type: application/json
{
"author": "codeit",
"password": "001122",
"title": "First post",
"content": "Hello, this is my first post.",
"tags": ["greeting", "first"]
}
### Get Post 1
GET http://localhost:8080/api/posts/1
### Update Post 1
PUT http://localhost:8080/api/posts/1
Content-Type: application/json
{
"password": "001122",
"title": "Say, Hello.",
"content": "Hello, this is my first post.",
"tags": ["greeting", "first", "hello"]
}
### Update Post 1, wrong password
PUT http://localhost:8080/api/posts/1
Content-Type: application/json
{
"password": "000000",
"title": "Say, Hello.",
"content": "WRONG PASSWORD",
"tags": ["greeting", "wrong password"]
}
### Get All Posts
GET http://localhost:8080/api/posts
### Delete Post 1, wrong password
DELETE http://localhost:8080/api/posts/1
Content-Type: application/json
{
"password": "000000"
}
### Delete Post 1
DELETE http://localhost:8080/api/posts/1
Content-Type: application/json
{
"password": "001122"
}