I want to get access token Build Your Own Brokerage With FastAPI - Part 1 in the last sessions.
when I try
import requests
url = "http://127.0.0.1:8000/platform/signup/"
payload = {
"email": "testing@test.com",
"password": "password"
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
# Successful request
data = response.json()
access_token = data["access_token"]
refresh_token = data["refresh_token"]
cognito_user_id = data["cognito_user_id"]
print(f"Access token: {access_token}")
print(f"Refresh token: {refresh_token}")
print(f"Cognito user ID: {cognito_user_id}")
else:
# Handle error
print(f"Request failed with status code {response.status_code}")
it show error
"POST /platform/signup/ HTTP/1.1" 400 Bad Request
instead of Response:
{
"access_token": "[OMITTED]",
"refresh_token": "[OMITTED]",
"cognito_user_id": "[OMITTED]"
}
what should I do ??