Skip to content
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

May getValue response type be configurable #2

Open
gypapp opened this issue Sep 26, 2019 · 0 comments
Open

May getValue response type be configurable #2

gypapp opened this issue Sep 26, 2019 · 0 comments

Comments

@gypapp
Copy link

gypapp commented Sep 26, 2019

I've come across a bit uncomfortable issue with getValue()

getValue(key) returns the corresponding API response in binary form only:

        return requests.get(url).content

Though I understand this is the most generic form, in this case, I would prefer to diverge from the original API and let the caller specify what type of response is expected. Mostly because it is just a matter of what property is used in the expression above and in case of json it results in some boilerplate code on the caller side.

As far as I understand from the docs a similar educated guess is done in Javascript version of this API:

Returns: Promise<(Object|String|Buffer)> - Returns a promise that resolves to an object, string or Buffer, depending on the MIME content type of the record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant