initial commit

This commit is contained in:
2020-05-22 02:40:51 +02:00
commit 1733c32c41
15 changed files with 570 additions and 0 deletions

18
test.py Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env python3
import requests
import os.path
import json
URL = "http://127.0.0.1:8080/sample"
FILE = 'CommonStarling_102761_45.wav'
files = {
"file": (os.path.basename(FILE), open(FILE,'rb').read(), 'audio/wave', {'Content-length' : os.path.getsize(FILE)}),
"description" : (None, json.dumps({"device_id" : "123"}), "application/json")
}
r = requests.post(URL,files=files)
print("Content: ", r.content)
print("Headers:", r.headers)
r.raise_for_status()