-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.http
133 lines (84 loc) · 2.85 KB
/
api.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
# PRUEBAS API PARA MI SISTEMA - API MEMES
### Api Info:
GET http://localhost:1947/api/
### Ping con OS-node:
GET http://localhost:1947/api/ping
### Búsqueda por usuario (requiere token):
GET http://localhost:1947/api/users/USUARIO1
Authorization: token123
### Crear un usuario:
POST http://localhost:1947/api/users/register
Content-Type: application/json
{
"mail": "test10@gmail.com",
"username": "test10",
"password": "123456789",
"token": "",
"interests": ["animals", "kids", "comics"]
}
### Login de un usuario: (FUNCIONA BIEN CON POSTMAN)
POST http://localhost:1947/api/users/login
Content-Type: application/json
{
"username": "test10",
"password": "12345678"
}
### Modificar un usuario: (FUNCIONA BIEN CON POSTMAN)
PATCH http://localhost:1947/api/users/test10
Content-Type: application/json
{ "username": "test10",
"mail": "prueba@gmail.com"
}
Authorization: eca06d1d-a389-4313-a1e4-7d2abae07449
### Eliminar un usuario: (FUNCIONA BIEN CON POSTMAN)
DELETE http://localhost:1947/api/users/test10
CONTENT-TYPE: application/json
{"username": "test10"}
Authorization: eca06d1d-a389-4313-a1e4-7d2abae07449
### Logout de usuario: (FUNCIONA BIEN CON POSTMAN)
DELETE http://localhost:1947/api/users/logout
Content-Type: application/json
{
"username": "test001"
}
Authorization: 66d628c5-b3a3-475c-9470-22d94536f0d4
### Obtener todos los memes:
GET http://localhost:1947/api/memes
### Obtener memes por author, con query params:
GET http://localhost:1947/api/memes/?author=test005
### Obtener meme por ID:
GET http://localhost:1947/api/memes/aaf05466-1dc1-4958-bcad-16175314971d
### Crear un nuevo meme:(FUNCIONA BIEN CON POSTMAN)
POST http://localhost:1947/api/memes/
Content-Type: application/json
{
"id": "",
"name": "ya wey",
"categories": ["girl", "humor", "scenes"],
"author": "test005",
"imageUrl": "https://i.kym-cdn.com/entries/icons/original/000/045/575/blackcatzoningout_meme.jpg",
"likes": [""]
}
Authorization: fbbcacda-aa9a-4c37-8012-ceaaa44bd1e5
### Modificar un meme:(FUNCIONA BIEN CON POSTMAN)
PATCH http://localhost:1947/api/memes/4475e7ca-3a83-455c-90d9-8804e1d70dcc
Content-Type: application/json
{
"id": "4475e7ca-3a83-455c-90d9-8804e1d70dcc",
"name": "michito",
"categories": ["cats", "faces", "animals"]
}
Authorization: fbbcacda-aa9a-4c37-8012-ceaaa44bd1e5
### Borrar un meme:(FUNCIONA BIEN CON POSTMAN)
DELETE http://localhost:1947/api/memes/aaf05466-1dc1-4958-bcad-16175314971d
Content-Type: application/json
Authorization: fbbcacda-aa9a-4c37-8012-ceaaa44bd1e5
### Dar un like al meme: (FUNCIONA BIEN CON POSTMAN)
PATCH http://localhost:1947/api/memes/f258c01f-38e8-4867-8ffb-66f9f16e27de/like
Content-Type: application/json
{
"username": "laura55"
}
Authorization: 66d628c5-b3a3-475c-9470-22d94536f0d4
### Mostrar top 5 de memes más likeados:
GET http://localhost:1947/api/memes/top5