Python 3 is required. There are ways to send requests to server. httpie and curl are simple and useful tools. Their use can be seen below.
git clone https://github.com/melihcolpan/flask-restful-login
cd flask-restful-login
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python -m main
For requests using httpie: https://httpie.org/doc
http POST :5000/v1/auth/register username=example_username password=example_password [email protected]
http POST :5000/v1/auth/login [email protected] password=example_password
http POST :5000/v1/auth/logout Authorization:"bearer ACCESS_TOKEN" refresh_token=REFRESH_TOKEN
http POST :5000/v1/auth/login [email protected] password=test_password
http POST :5000/v1/auth/login [email protected] password=admin_password
http POST :5000/v1/auth/login [email protected] password=sa_password
http GET :5000/user_add Authorization:"bearer ACCESS_TOKEN"
http GET :5000/users Authorization:"Bearer ACCESS_TOKEN" usernames==test_username,admin_username [email protected],[email protected] start_date==01.01.1993 end_date==01.01.2050
http GET :5000/data_admin Authorization:"Bearer ACCESS_TOKEN"
http GET :5000/data_user Authorization:"Bearer ACCESS_TOKEN"
For requests using curl: https://curl.haxx.se/download.html
curl -H "Content-Type: application/json" --data '{"username":"example_name","password":"example_password", "email":"[email protected]"}' http://localhost:5000/v1/auth/register
curl -H "Content-Type: application/json" --data '{"email":"[email protected]", "password":"example_password"}' http://localhost:5000/v1/auth/login
curl -H "Content-Type: application/json" -H "Authorization: Bearer ACCESS_TOKEN" --data '{"refresh_token":"REFRESH_TOKEN"}' http://localhost:5000/v1/auth/logout
curl -H "Content-Type: application/json" --data '{"password":"test_password", "email":"[email protected]"}' http://localhost:5000/v1/auth/login
curl -H "Content-Type: application/json" --data '{"password":"admin_password", "email":"[email protected]"}' http://localhost:5000/v1/auth/login
curl -H "Content-Type: application/json" --data '{"password":"sa_password", "email":"[email protected]"}' http://localhost:5000/v1/auth/login
curl -H "Content-Type: application/json" -H "Authorization: Bearer ACCESS_TOKEN" http://localhost:5000/user_add
curl -X GET 'localhost:5000/users?usernames=test_username,admin_username&[email protected],[email protected]&start_date=01.01.1993&end_date=01.01.2050' -H "Content-Type: application/json" -H "Authorization: Bearer ACCESS_TOKEN"
curl -H "Content-Type: application/json" -H "Authorization: Bearer ACCESS_TOKEN" http://localhost:5000/data_admin
curl -H "Content-Type: application/json" -H "Authorization: Bearer ACCESS_TOKEN" http://localhost:5000/data_user