Dateien hochladen nach „REST“

added Header Response Data (missing?)
main
Thomas Hassenstein 2023-06-20 15:15:45 +02:00
parent 724b8a8b68
commit 529ae8f5d1
1 changed files with 5 additions and 2 deletions

View File

@ -13,10 +13,13 @@ initialized = False
lock = Lock() # Sperre (Lock) für die analyze_data-Methode lock = Lock() # Sperre (Lock) für die analyze_data-Methode
def create_response(status_code, description): def create_response(status_code, description):
return jsonify({ response_data = {
'status': status_code, 'status': status_code,
'description': description 'description': description
}) }
response = make_response(jsonify(response_data))
response.status_code = status_code
return response
@app.route('/trng/randomNum/init', methods=['GET']) @app.route('/trng/randomNum/init', methods=['GET'])
def initialize_generator(): def initialize_generator():