From 3817b1ac5a4d0d841d9035408b4708bcbe5c5940 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Mon, 30 Jan 2023 10:53:39 +0100 Subject: [PATCH] API now ignores content-type header (to increase compatibility with Java backend) --- Backend-libXML/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Backend-libXML/main.py b/Backend-libXML/main.py index 1af4e90..3fd45e5 100644 --- a/Backend-libXML/main.py +++ b/Backend-libXML/main.py @@ -11,7 +11,7 @@ app = Flask(__name__) @app.route("/xpath", methods=["POST"]) def xpath(): start = time.time_ns() - request_data = request.get_json() + request_data = json.loads(request.get_data(as_text=True)) xml = request_data['data'] xpath = request_data['process'] @@ -31,7 +31,7 @@ def xpath(): @app.route("/xsd", methods=["POST"]) def xsd(): start = time.time_ns() - request_data = request.get_json() + request_data = json.loads(request.get_data(as_text=True)) xml = request_data['data'] xsd = request_data['process']