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.
I've come across a bit uncomfortable issue with
getValue()getValue(key)returns the corresponding API response in binary form only: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: