From b0b650035e8b25c62bb5e74c7d932c1291de1a2b Mon Sep 17 00:00:00 2001 From: ramon Date: Mon, 3 Apr 2017 12:29:57 +0000 Subject: [PATCH] =?UTF-8?q?#718:=20Agente=20OGAgent=20usa=20mensajes=20en?= =?UTF-8?q?=20UTF-8;=20actualizar=20definici=C3=B3n=20de=20la=20API=20REST?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://opengnsys.es/svn/branches/version1.1@5256 a21b9725-9963-47de-94b9-378ad31fedc9 --- src/opengnsys/httpserver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/opengnsys/httpserver.py b/src/opengnsys/httpserver.py index a7b4ddf..a06ae6b 100644 --- a/src/opengnsys/httpserver.py +++ b/src/opengnsys/httpserver.py @@ -104,10 +104,10 @@ class HTTPServerHandler(BaseHTTPRequestHandler): def do_POST(self): module, path, getParams = self.parseUrl() - # Tries to get json content + # Tries to get JSON content (UTF-8 encoded) try: length = int(self.headers.getheader('content-length')) - content = self.rfile.read(length) + content = self.rfile.read(length).decode('utf-8') logger.debug('length: {}, content >>{}<<'.format(length, content)) postParams = json.loads(content) except Exception as e: @@ -147,4 +147,4 @@ class HTTPServerThread(threading.Thread): def run(self): self.server.serve_forever() - \ No newline at end of file +