From 529ae8f5d11c9b867ade81dd243888fb6f774ff6 Mon Sep 17 00:00:00 2001 From: Thomas Hassenstein <2021544@stud.hs-mannheim.de> Date: Tue, 20 Jun 2023 15:15:45 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9EREST?= =?UTF-8?q?=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit added Header Response Data (missing?) --- REST/app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/REST/app.py b/REST/app.py index 4e00f51..24f65eb 100644 --- a/REST/app.py +++ b/REST/app.py @@ -13,10 +13,13 @@ initialized = False lock = Lock() # Sperre (Lock) für die analyze_data-Methode def create_response(status_code, description): - return jsonify({ + response_data = { 'status': status_code, 'description': description - }) + } + response = make_response(jsonify(response_data)) + response.status_code = status_code + return response @app.route('/trng/randomNum/init', methods=['GET']) def initialize_generator():