Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Change Proposals
- ## HTTP Request, Response, Message and Header
- ```mermaid
- classDiagram
- direction TD
- class HTTPHeader {
- + name: str
- - _directives: list[str, ...]
- + __init__(self, name, directives) -> HTTPHeader
- + @property value(self) -> str
- + __str__(self) -> str
- }
- class HTTPHeaders {
- - _headers: list[HTTPHeader, ...]
- + __init__(self, headers: dict | list[HTTPHeader, ...]) -> HTTPHeaders
- + get(self, key) -> str
- + set(self, key, value) -> None
- + __getitem__(self, key) -> str
- + __setitem__(self, key, value) -> None
- + __str__(self) -> str
- }
- class HTTPData:::abstract {
- + __str__(self) -> str
- }
- class HTTPMessage {
- + headers: HTTPHeaders
- + data: HTTPData
- + __str__(self) -> str
- + __init__(self) -> HTTPMessage
- }
- class HTTPRequest {
- + protocol: str
- + path: str
- + method: str
- + __str__(self) -> str
- + __init__(self) -> HTTPRequest
- }
- class HTTPResponse {
- + protocol: str
- + path: str
- + method: str
- + __str__(self) -> str
- + __init__(self) -> HTTPResponse
- }
- HTTPHeader o-- HTTPHeaders
- HTTPHeaders o-- HTTPMessage
- HTTPData o-- HTTPMessage
- HTTPMessage <|-- HTTPResponse
- HTTPMessage <|-- HTTPRequest
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement