Response
The Response class represents a response.
- class newsbinpro_client.response.Response(response: str)
Bases:
objectRepresents a response from a certain process or system.
The Response class is used to encapsulate the status code and the message obtained from a given input string. It parses the string to extract a 3-digit status code and the corresponding message.
- Methods:
__init__: Constructor that parses the input string, extracting and setting the status code and message.
status_code: Property to get or set the numeric status code.
message: Property to get or set the response message.
__str__: String representation combining the status code and message.
- Attributes:
status_code: An instance of StatusCode representing the parsed or default status code.
message: A string representing the parsed or default response message.
- property message: str
- Returns:
The private attribute _message, typically representing the stored message or information associated with the instance.
- property status_code: StatusCode
- Returns:
The HTTP status code associated with the response.