first commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
from requests import get, post
|
||||
|
||||
ip = "http://192.168.0.209:8100"
|
||||
param = {
|
||||
"username": "tangchao",
|
||||
"password": "123456a",
|
||||
"client_id": "client",
|
||||
"grant_type": "password",
|
||||
"client_secret": "123456",
|
||||
}
|
||||
data = get(
|
||||
url=f"{ip}/oauth/token?username=zhongwei&password=123456a&client_id=client&grant_type=password&client_secret=123456"
|
||||
).json()
|
||||
token = data["access_token"]
|
||||
header = {
|
||||
"content-type": "application/json",
|
||||
"authorization": f"Bearer {token}",
|
||||
}
|
||||
Reference in New Issue
Block a user