Skip to content
This repository was archived by the owner on Jun 16, 2021. It is now read-only.

REST client crashes after the first request #15

Open
paoloantinori opened this issue Nov 22, 2012 · 0 comments
Open

REST client crashes after the first request #15

paoloantinori opened this issue Nov 22, 2012 · 0 comments

Comments

@paoloantinori
Copy link

In specific setups the webserver does not allow the reuse of the connection, so you cannot send more than n requests.

In my case I had an exception already during the second request.

i have solved the problem modifying client.py wrapping the remote invocation in a try/finally block and recreating a new connection every time.

Not the best performance but I think it's acceptable for the tool use case.

   try:
      resp = self.http_conn.getresponse()
    finally:
      self.http_conn = HTTPConnection(self.host, self.port)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant