Commit eba9be52 authored by Rudy BARAGLIA's avatar Rudy BARAGLIA
Browse files

API modifications server-side and client side

parent 01f9e739
......@@ -16,7 +16,7 @@ SERVER_REQUEST_PATH = u"/client/post/speech"
def main():
with open('../linSTT-dispatch/tests/mocanu-Samy.wav', 'rb') as f:
r = requests.post(SERVER_ADRESS+SERVER_PORT+SERVER_REQUEST_PATH, files={'file_to_transcript': f})
r = requests.post(SERVER_ADRESS+SERVER_PORT+SERVER_REQUEST_PATH, files={'wavFile': f})
print(type(r))
print(r.headers)
print(r.status_code)
......
......@@ -85,11 +85,11 @@ class DecodeRequestHandler(tornado.web.RequestHandler):
self.finish()
#File Retrieval
# TODO: Adapt input to existing controller API
if 'file_to_transcript' not in self.request.files.keys():
if 'wavFile' not in self.request.files.keys():
self.set_status(403, "POST request must contain a 'file_to_transcript' field.")
self.finish()
logging.debug("POST request from %s does not contain 'file_to_transcript' field.")
temp_file = self.request.files['file_to_transcript'][0]['body']
temp_file = self.request.files['wavFile'][0]['body']
self.temp_file = temp_file
#Writing file
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment