-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate client to requests
and add get_some_beamline_params
#49
Conversation
if options | ||
else "" | ||
r = requests.get( | ||
self._url + endpoint + (f"/{item}" if item else ""), options, json=data |
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.
We should urlencode path parameters using something like urllib.parse.quote()
- looks like requests does not have a convenient way to encode them and only supports query params.
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 don't see how this would really help that much, urllib
also doesn't support combining components of the path either? Anyway, could we make that into a new issue since this already fixes some problems? #53
if options | ||
else "" | ||
r = requests.get( | ||
self._url + endpoint + (f"/{item}" if item else ""), options, json=data |
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.
json=data
? Are we sending json in GET request body? Seems like a bad idea. What is this really doing?
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.
yes, for getting a specific list of beamline params. what do you think is a better way of doing it? query params don't nicely support putting a list in there
Fixes #40 and Fixes #41 and fixes #52
Uses the
requests
library which automatically manages connection keepalive and adds a method to get a list of specific beamline params