{
"detail":"Unsupported media type \"text/plain\" in request."
}

{
"detail":"Unsupported media type \"text/plain\" in request."
}

Its occure because of content type of your request .
For example :
Header -> add key: “Content-Type” value: “application/json”
def do(method ='get', data={}, is_json =True):
headers = {}
if is_json:
headers['content-type'] ='application/json'
data = json.dumps(data)
r = requests.request(method, ENDPOINT, data=data, headers = headers )
print(r.text)
print(r.status_code)
return r
do(method='post', data={"content": "some cool api ", 'user':1})