-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
@@ -15,7 +15,6 @@ class RESTApiClient: | |||
|
|||
def __init__(self, service_base): | |||
self.service_base = service_base | |||
self.client = requests.session() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as we're not using this session, we can indeed delete this code. But maybe we should use a session? (By using the session's get
and post
instead of request.get
and request.post
in our own get
and post
methods below.) We don't need cookie persistence, but connection-pooling might be good.
And it seems that requests.Session
already can do what we implemented ourselves with _data_dict()
and _default_headers()
: http://docs.python-requests.org/en/master/api/#requests.Session.headers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that, and AFAIK that line stems from an idea where I implemented it this way - but forgot about it again, and didn't remember while reviewing.
I created the issue #508 for this, since this doesn't belong in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@das-g I made some changes, so I took the liberty of removing your check-mark above. |
Reviewed by:
While working on #502 I found that we have some code around, we're not using. I cleaned this up as far as I was able to tell, with one exception: removing the countries altogether (they live on the excerpts now), but they need to be available for migrations, which is a bigger task #506, so not included here.