Skip to content

Response

Class to handle any API response from the Solcast API.

Attributes:

Name Type Description
code int

HTTP status code of the response

url str

The URL that was requested

data Optional[bytes]

Raw response data as bytes

success bool

Whether the request was successful

method str

HTTP method used (GET, POST, etc.)

exception Optional[str]

Exception message if request failed

Examples:

>>> response = Response(code=200, url="...", data=b"...", success=True, method="GET")
>>> response.to_dict()

to_dict()

Return the data as a dictionary.