-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatuscodes.http
More file actions
75 lines (49 loc) · 1.64 KB
/
statuscodes.http
File metadata and controls
75 lines (49 loc) · 1.64 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
67
68
69
70
71
72
73
74
75
@host = http://localhost:8080/api
# 2XX CLASS
### 200 - OK: Busca pessoa por id
GET {{host}}/pessoa/1
### 200 - OK: Busca pessoa por nome
GET {{host}}/pessoa?nome=Emanuel
### 201 - CREATED: Cria pessoa
POST {{host}}/pessoa
Content-Type: application/json
{
"id": 999,
"nome": "Fulano"
}
### 200 - OK: Status do servidor
GET {{host}}/status
### 204 - NO CONTENT: Deleta pessoa por id
DELETE {{host}}/pessoa/4
# 3XX CLASS
### 301 - PERMANENTLY MOVED: Tenta buscar pessoa por nome usando URL antiga
GET {{host}}/pessoa/nome/Fulano
### 301 - PERMANENTLY MOVED: Tenta buscar pessoa por id usando URL antiga, mas spring redireciona para endpoint novo e retorna resposta correta (ver código)
GET {{host}}/pessoa/id/1
### 304 - NOT MODIFIED: Verificar se usuário ainda existe
GET {{host}}/pessoa/1/existente
# 4XX CLASS
### 400 - BAD REQUEST: Tenta buscar pessoa passando String no lugar do id
GET {{host}}/pessoa/a
### 403 - FORBIDDEN: Tenta acessar recurso (fictício) que você não tem permissão
GET {{host}}/pessoa/1/cpf
### 404 - NOT FOUND: nome inexistente
GET {{host}}/pessoa?nome=asdad
### 404 - NOT FOUND: id inexistente
GET {{host}}/pessoa/999
### 404 - NOT FOUND: path inexistente
GET {{host}}/carro
### 405 - METHOD NOT ALLOWED: Usa método HTTP errado na requisição
POST {{host}}/pessoa/1
### 409 - CONFLICT: Tenta criar pessoa já existente
POST {{host}}/pessoa
Content-Type: application/json
{
"id": 999,
"nome": "Victor"
}
# 5XX CLASS
### 500 - INTERNAL SERVER ERROR: Tenta deletar usuário que não existe
DELETE {{host}}/pessoa/999
### 501 - NOT IMPLEMENTED: Tenta acessar recurso ainda não pronto
GET {{host}}/pessoa/1/idade