Advertisement
Guest User

Untitled

a guest
Nov 7th, 2023
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. # Change Proposals
  2.  
  3. ## HTTP Request, Response, Message and Header
  4. ```mermaid
  5. classDiagram
  6. direction TD
  7.  
  8. class HTTPHeader {
  9. + name: str
  10. - _directives: list[str, ...]
  11.  
  12. + __init__(self, name, directives) -> HTTPHeader
  13. + @property value(self) -> str
  14. + __str__(self) -> str
  15. }
  16.  
  17. class HTTPHeaders {
  18. - _headers: list[HTTPHeader, ...]
  19.  
  20. + __init__(self, headers: dict | list[HTTPHeader, ...]) -> HTTPHeaders
  21. + get(self, key) -> str
  22. + set(self, key, value) -> None
  23. + __getitem__(self, key) -> str
  24. + __setitem__(self, key, value) -> None
  25. + __str__(self) -> str
  26. }
  27.  
  28. class HTTPData:::abstract {
  29. + __str__(self) -> str
  30. }
  31.  
  32. class HTTPMessage {
  33. + headers: HTTPHeaders
  34. + data: HTTPData
  35.  
  36. + __str__(self) -> str
  37. + __init__(self) -> HTTPMessage
  38. }
  39.  
  40. class HTTPRequest {
  41. + protocol: str
  42. + path: str
  43. + method: str
  44.  
  45. + __str__(self) -> str
  46. + __init__(self) -> HTTPRequest
  47. }
  48.  
  49. class HTTPResponse {
  50. + protocol: str
  51. + path: str
  52. + method: str
  53.  
  54. + __str__(self) -> str
  55. + __init__(self) -> HTTPResponse
  56. }
  57.  
  58. HTTPHeader o-- HTTPHeaders
  59. HTTPHeaders o-- HTTPMessage
  60. HTTPData o-- HTTPMessage
  61. HTTPMessage <|-- HTTPResponse
  62. HTTPMessage <|-- HTTPRequest
  63.  
  64. ```
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement