-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiTestFile
38 lines (19 loc) · 1.17 KB
/
apiTestFile
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
Example cURL Commands:
User Registration:
sh
curl -X POST http://127.0.0.1:8000/api/register/ -d '{"email": "[email protected]", "password": "password123", "password2": "password123", "first_name": "John", "last_name": "Doe", "date_of_birth": "2000-01-01"}' -H "Content-Type: application/json"
User Login:
sh
curl -X POST http://127.0.0.1:8000/api/login/ -d '{"email": "[email protected]", "password": "password123"}' -H "Content-Type: application/json"
User Profile (authenticated):
sh
curl -X GET http://127.0.0.1:8000/api/profile/ -H "Authorization: Bearer <access_token>"
Change Password (authenticated):
sh
curl -X POST http://127.0.0.1:8000/api/change-password/ -d '{"password": "newpassword123", "password2": "newpassword123"}' -H "Content-Type: application/json" -H "Authorization: Bearer <access_token>"
Send Password Reset Email:
sh
curl -X POST http://127.0.0.1:8000/api/send-reset-password-email/ -d '{"email": "[email protected]"}' -H "Content-Type: application/json"
Reset Password:
sh
curl -X POST http://127.0.0.1:8000/api/reset-password/<uid>/<token>/ -d '{"password": "newpassword123", "password2": "newpassword123"}' -H "Content-Type: application/json"