When making a post request to Hug (v2.5.0), i never get a response. If I Ctrl-C the hug process, i get the following trackback...
Traceback (most recent call last):
File "/usr/local/lib/python3.7/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/lib/python3.7/site-packages/falcon/api.py", line 269, in __call__
responder(req, resp, **params)
File "/usr/local/lib/python3.7/site-packages/hug/interface.py", line 762, in __call__
input_parameters = self.gather_parameters(request, response, context, api_version, **kwargs)
File "/usr/local/lib/python3.7/site-packages/hug/interface.py", line 611, in gather_parameters
body = body_formatter(body, content_length=request.content_length, **content_params)
File "/usr/local/lib/python3.7/site-packages/hug/input_format.py", line 43, in json
return json_converter.loads(text(body, charset=charset))
File "/usr/local/lib/python3.7/site-packages/hug/input_format.py", line 37, in text
return body.read().decode(charset)
File "/usr/local/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
KeyboardInterrupt
Version 2.4.9 seems to work just fine.
- Build the docker image
docker build -t hug-bug --no-cache .
- Run hug
docker run --rm -it -v $(pwd):/app -p 5454:5454 hug-bug
- Curl our hug service
curl -H "Content-Type: application/json" -X POST -d '{"foo":"bar"}' "localhost:5454/test"