sample commands
This commit is contained in:
parent
74a22c2721
commit
5709b6224e
2 changed files with 17 additions and 0 deletions
7
curls.txt
Normal file
7
curls.txt
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
curl -XPOST http://localhost:8080/api/v1/security/login -d \ '{"username": "admin", "password": "admin", "provider": "db"}' \
|
||||||
|
-H "Content-Type: application/json"
|
||||||
|
{
|
||||||
|
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1Nzk4ODQ3NzksIm5iZiI6MTU3OTg4NDc3OSwianRpIjoiMjc2MTQ0YzgtNDEyYS00ZjBhLWE0MjAtOGEzODhmMmQ4OWJkIiwiZXhwIjoxNTc5ODg1Njc5LCJpZGVudGl0eSI6MSwiZnJlc2giOnRydWUsInR5cGUiOiJhY2Nlc3MifQ.6bbZWdSPhtpydVp5ef_A8EjKGopypmET_dnKZb5rW2s"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
10
send_json.py
Normal file
10
send_json.py
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import json
|
||||||
|
import requests
|
||||||
|
|
||||||
|
r = requests.post("http://localhost:8080/api/v1/security/login", data='{"username": "admin", "password": "admin", "provider": "db"}')
|
||||||
|
print(r.text)
|
||||||
|
print(r["access_token"])
|
||||||
|
|
||||||
|
r = requests.get("http://localhost:8080/api/v1/spiel/", auth=("admin","admin"))
|
||||||
|
|
||||||
|
print(r)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue