-
Notifications
You must be signed in to change notification settings - Fork 43
/
rest.http
53 lines (37 loc) · 1014 Bytes
/
rest.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
# To be used with the "REST Client" VS Code extension by Huachao Mao
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
### Variables
@host=http://127.0.0.1:8000
@username=neoxx
@password=always-use-strong-passwords-in-production
@token=just-login-to-get-one
### Create new account
POST {{host}}/auth/users/
Content-Type: application/json
{
"username": "{{username}}",
"email": "{{email}}",
"password": "{{password}}",
"re_password": "{{password}}"
}
### Login
POST {{host}}/auth/token/login/
Content-Type: application/json
{
"username": "{{username}}",
"password": "{{password}}"
}
### Logout
POST {{host}}/auth/token/logout/
Authorization: Token {{token}}
### Create new question
POST {{host}}/api/v1/questions/
Content-Type: application/json
Authorization: Token {{token}}
{
"content": "Is this question the best test one ever asked!?"
}
### Get question list
GET {{host}}/api/v1/questions/
Authorization: Token {{token}}