forked from Dongjiaqi/reposync
24 lines
696 B
Python
24 lines
696 B
Python
import requests
|
|
import json
|
|
|
|
url = "https://gitlink.org.cn/oauth/token"
|
|
|
|
payload = json.dumps({
|
|
"grant_type": "password",
|
|
"username": "xumingyang21",
|
|
"password": "185102xmy",
|
|
"client_id": "cPY5xnUHvNjcG6pon2IizuPzmci7PDjtndbgxjNKJDM",
|
|
"client_secret": "yb-2WGqGm6RercEJq0o_QM6aZtHzRExhQB5TiAQ-Z1M"
|
|
})
|
|
|
|
access_token = 'e8c55cbb234637593fd6e97e59f3947120d5a3c0'
|
|
headers = {
|
|
'Cookie': 'autologin_trustie=89968cdf00f5d75ffd06e679402a646ba2fa7671',
|
|
'Authorization': f'Bearer {access_token}',
|
|
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
|
|
'Content-Type': 'application/json'
|
|
}
|
|
|
|
response = requests.request("POST", url, headers=headers, data=payload)
|
|
|
|
print(response.text) |