Skip to content

Request Response codes are lost #99

Description

@smorloc

The API documentation at https://developers.mailerlite.com/ describe the response codes to the documented requests. Unfortunately, Responses are not passed back to clients of this Python SDK, so the Response status code is lost. This loss occurs because callers of api_client.request() immediately take the request Response and call method json() on it. This method converts only the 'content' of the Response to JSON. All other information in the Response instance are lost.

This is an example return statement from an SDK method:

    return self.api_client.request(
        "GET", f"{self.base_api_url}/import/{import_id}"
    ).json()

The caller of this SDK method would never be able to test the status code because only the JSON of the response contents is returned.

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