forked from ProgrammerZamanNow/belajar-bun-hono-restful-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.http
147 lines (122 loc) · 3.37 KB
/
test.http
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
GET http://localhost:3000
### Register User
POST http://localhost:3000/api/users
Content-Type: application/json
Accept: application/json
{
"username" : "eko",
"password" : "eko123",
"name" : "Eko Kurniawan"
}
### Login User
POST http://localhost:3000/api/users/login
Content-Type: application/json
Accept: application/json
{
"username" : "eko",
"password" : "rahasia"
}
### Get Current User
GET http://localhost:3000/api/users/current
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
### Update Current User
PATCH http://localhost:3000/api/users/current
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
{
"name" : "Eko Kurniawan Khannedy"
}
### Update Password
PATCH http://localhost:3000/api/users/current
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
{
"password" : "rahasia"
}
### Logout User
DELETE http://localhost:3000/api/users/current
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
### Create Contact
POST http://localhost:3000/api/contacts
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
{
"first_name" : "Salah 2",
"last_name" : "Last Name",
"email" : "[email protected]",
"phone" : "23423432434"
}
### Search Contact
GET http://localhost:3000/api/contacts
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
### Detail Contact
GET http://localhost:3000/api/contacts/1446
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
### Update Contact
PUT http://localhost:3000/api/contacts/1444
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
{
"id": 1444,
"first_name": "Kontak 1",
"last_name": "Eko",
"email": "[email protected]",
"phone": "123123"
}
### Delete Contact
DELETE http://localhost:3000/api/contacts/1446
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
### Create Address
POST http://localhost:3000/api/contacts/1444/addresses
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
{
"street" : "Jalan A",
"city" : "Jakarta",
"province" : "DKI Jakarta",
"country" : "Indonesia",
"postal_code" : "234234"
}
### List Address
GET http://localhost:3000/api/contacts/1444/addresses
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
### Detail Address
GET http://localhost:3000/api/contacts/1444/addresses/104
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
### Update Address
PUT http://localhost:3000/api/contacts/1444/addresses/101
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343
{
"id": 101,
"street": "Jalan B",
"city": "Bandung",
"province": "Jawa Barat",
"country": "Indonesia",
"postal_code": "234234"
}
### Delete Address
DELETE http://localhost:3000/api/contacts/1444/addresses/101
Content-Type: application/json
Accept: application/json
Authorization: 9e6e8c80-bc4b-4936-8ed8-debbe9c4c343