Why is the same restful api API when I use it with react and java android I don't get error 415 but when I use python requests I get an error: "title":"Unsupported Media Type","status":415
URL = "http://localhost:44327/api/UserOfficial/UserOfficialAuthenticate"
def Login():
data = {
'username': 'hienkieu',
'password': '197353995'
}
length = len(json.dumps(data))
hearder = {
'accept': 'application/json',
'content-Type' : 'application/json',
'content-Length': length
}
r = requests.post(URL, data, hearder)
return r.text
Please try to do this.