Translator-GO-Endpoint/tests/test.py

19 lines
408 B
Python
Raw Permalink Normal View History

import requests
import json
url = "https://tl.fabelous.app/api/rogQxDpALQdFDEYihACT/"
headers = {
"Authorization": "Token yQfZjxLCWYZQXTjepQAm",
"Content-Type": "application/json"
}
data = {
"message": "Hello, world!",
"from": "en",
"to": "de"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.status_code)
print(response.json())