Module slack_sdk.http_retry.response

Classes

class HttpResponse (*,
status_code: str | int,
headers: Dict[str, str | List[str]],
body: Dict[str, Any] | None = None,
data: bytes | None = None)

HTTP response representation

Expand source code
class HttpResponse:
    """HTTP response representation"""

    status_code: int
    headers: Dict[str, List[str]]
    body: Optional[Dict[str, Any]]
    data: Optional[bytes]

    def __init__(
        self,
        *,
        status_code: Union[int, str],
        headers: Dict[str, Union[str, List[str]]],
        body: Optional[Dict[str, Any]] = None,
        data: Optional[bytes] = None,
    ):
        self.status_code = int(status_code)
        self.headers = {k: v if isinstance(v, list) else [v] for k, v in headers.items()}
        self.body = body
        self.data = data

Class variables

var body : Dict[str, Any] | None

The type of the None singleton.

var data : bytes | None

The type of the None singleton.

var headers : Dict[str, List[str]]

The type of the None singleton.

var status_code : int

The type of the None singleton.