Skip to content

May getValue response type be configurable #2

Description

@gypapp

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions