diff --git a/src/api/route/InputServiceServer.kt b/src/api/route/InputServiceServer.kt index 63dc090..1c4e0a1 100644 --- a/src/api/route/InputServiceServer.kt +++ b/src/api/route/InputServiceServer.kt @@ -77,6 +77,7 @@ class InputServiceServer { is PartData.FormItem -> { if (part.name == "description") { val gson = Gson() + print(part.value) description = gson.fromJson(part.value, SampleObject::class.java) } } diff --git a/test.py b/test.py index b61e63a..ce19791 100644 --- a/test.py +++ b/test.py @@ -10,7 +10,7 @@ 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({'date' : datetime.now().isoformat(), 'device_id' : '123'}), "application/json") + "description" : (None, json.dumps({"date" : datetime.now().isoformat(), "device_id" : "123"}), "application/json") } r = requests.post(URL,files=files)