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.
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:
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.