Skip to content

Commit

Permalink
Use a requests session per FinTSHTTPSConnection (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgruenewald committed Mar 28, 2024
1 parent 39f1aae commit 3df572f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fints/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
class FinTSHTTPSConnection:
def __init__(self, url):
self.url = url
self.session = requests.session()

def send(self, msg: FinTSMessage):
log_out = io.StringIO()
Expand All @@ -22,7 +23,7 @@ def send(self, msg: FinTSMessage):
logger.debug("Sending >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n{}\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n".format(log_out.getvalue()))
log_out.truncate(0)

r = requests.post(
r = self.session.post(
self.url, data=base64.b64encode(msg.render_bytes()),
headers={
'Content-Type': 'text/plain',
Expand Down

0 comments on commit 3df572f

Please sign in to comment.