I want to tell you that I developed an api with fastAPI, now I was trying to connect and upload information as a json object to it through the post request but nothing is loaded,I have a method with which I try to insert the data.I Will it be ok how do I post request? I hope you can help me, I leave my code below:
def inyectionDataInternettoFastAPI(id,date_init,date_end,status_internet):
tk = 'Bearer <token>'
password ='admin'
username ='admin'
url = 'http://URL'
headers = {'content-type': 'application/json', 'Accept':'application/json'}
data ={
'date_init':date_init,
'date_end':date_end,
'state':status_internet,
'monitor_id':id
}
requests.post(url,auth=(username,password),json=data)