forked from abramhindle/CMPUT404-project-socialdistribution
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Yuan Wang edited this page Mar 26, 2020
·
11 revisions
"Authorization" : "Basic {dXNlcjJAZW1ha--ATOKEN--WwuY29tOnBhc3Nxd2Vy}" // if (Authorization) specified.
"Content-type" : "application/json"
We are using DRF Basic Authentication for authorization required API endpoints, so please include "Authorization" header when needed.
Example: if you have an account: Email: [email protected] Password: passqwer
, the authorization header would be like:
Authorization: Basic dXNlcjFAZW1haWwuY29tOnBhc3Nxd2Vy
dXNlcjFAZW1haWwuY29tOnBhc3Nxd2Vy
is base64 encoding of "[email protected]:passqwer"
In python3, you can convert utf-8 string to base64 encoding by:
>>> import base64
>>> base64.b64encode(bytes('[email protected]:passqwer', 'utf-8'))
b'dXNlcjFAZW1haWwuY29tOnBhc3Nxd2Vy'
Social Distribution: Make post, Add friend, Enjoy life!
Copyright (C) 2020 Qiaoyan Zhang, Devin Dai, Zhonghao Lu, Yuan Wang, Isaac Zhang