added test file and changed hopefully to utf8 translation
This commit is contained in:
parent
68032cb37d
commit
ff4aa0f63e
2
main.go
2
main.go
|
@ -126,7 +126,7 @@ func executeTranslator(w http.ResponseWriter, message, fromLanguage, toLanguage
|
|||
|
||||
scanner := bufio.NewScanner(output)
|
||||
for scanner.Scan() {
|
||||
messages <- scanner.Text()
|
||||
messages <- string(scanner.Bytes())
|
||||
}
|
||||
|
||||
err = cmd.Wait()
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
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())
|
Loading…
Reference in New Issue