October 2019
Intermediate to advanced
426 pages
10h 8m
English
This endpoint is essentially the same as the Upload Image Endpoint from Chapter 3, Detecting and Translating Text with Amazon Rekognition and Translate, Pictorial Translator application. It uses the same two functions that we implemented in the project without modification. The only change is the @app.route annotation, where we created a different HTTP POST endpoint, /recordings, that takes uploads via Base64 encoding:
@app.route('/recordings', methods = ['POST'], cors = True)def upload_recording(): """processes file upload and saves file to storage service""" request_data = json.loads(app.current_request.raw_body) file_name = request_data['filename'] file_bytes = base64.b64decode(request_data['filebytes']) file_info ...
Read now
Unlock full access