Terarea  2
The automation project
Loading...
Searching...
No Matches
src.lib.components.http_codes.HttpCodes Class Reference
Collaboration diagram for src.lib.components.http_codes.HttpCodes:
Collaboration graph

Public Member Functions

None __init__ (self)
 
Response send_message_on_status (self, int status=200, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response send_continue (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response switching_protocols (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response processing (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response early_hints (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response response_is_stale (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response success (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response created (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response accepted (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response non_authoritative_information (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response no_content (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response reset_content (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response partial_content (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response multi_status (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response already_reported (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response im_used (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response multiple_choices (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response moved_permanently (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response found (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response see_other (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response not_modified (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response use_proxy (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response switch_proxy (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response temporary_redirect (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response permanent_redirect (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response bad_request (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response unauthorized (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response payment_required (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response forbidden (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response not_found (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response method_not_allowed (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response not_acceptable (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response proxy_authentication_required (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response request_timeout (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response conflict (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response gone (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response length_required (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response precondition_failed (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response payload_too_large (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response uri_too_long (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response unsupported_media_type (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response range_not_satisfiable (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response expectation_failed (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response im_a_teapot (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response page_expired (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response enhance_your_calm (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response misdirected_request (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response unprocessable_entity (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response locked (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response failed_dependency (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response too_early (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response upgrade_required (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response precondition_required (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response too_many_requests (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response request_header_fields_too_large (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response unavailable_for_legal_reasons (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response invalid_token (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response internal_server_error (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response not_implemented (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response bad_gateway (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response service_unavailable (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response gateway_timeout (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response http_version_not_supported (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response variant_also_negotiates (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response insufficient_storage (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response loop_detected (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response bandwidth_limit_exceeded (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response not_extended (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 
Response network_authentication_required (self, Any content={ 'msg':'message'}, str content_type="JSON", Mapping[str, str] headers=None)
 

Data Fields

list authorised_statuses
 
dict data_types
 

Protected Member Functions

str _check_data_type (self, Union[str, None] data_type=None)
 
Any _check_header (self, Union[Mapping[str, str], None] header=None)
 
Any _process_data_content (self, Any data, str data_type)
 

Detailed Description

_summary_
A class containing all the known http codes that can be used to reply to websites.
These codes are:
* The 1xx: Continue
* The 2xx: Success
* The 3xx: Redirection
* The 4xx: Client error
* The 5xx: Server error

Definition at line 13 of file http_codes.py.

Constructor & Destructor Documentation

◆ __init__()

None src.lib.components.http_codes.HttpCodes.__init__ ( self)

Definition at line 24 of file http_codes.py.

Member Function Documentation

◆ _check_data_type()

str src.lib.components.http_codes.HttpCodes._check_data_type ( self,
Union[str, None] data_type = None )
protected
_summary_
Function in charge of checking the type provided by the user is one that can be used to send data.

Args:
    data_type (str, optional): _description_. Defaults to None.

Returns:
    str: _description_: Returns the correct known version of the sent data.

Definition at line 101 of file http_codes.py.

◆ _check_header()

Any src.lib.components.http_codes.HttpCodes._check_header ( self,
Union[Mapping[str, str], None] header = None )
protected
_summary_
Function in charge of checking the headers provided by the user.
Args:
    header (Mapping[str, str], optional): _description_. Defaults to None.
Returns:
    Any: _description_: Returns the correct known version of the sent headers.

Definition at line 123 of file http_codes.py.

◆ _process_data_content()

Any src.lib.components.http_codes.HttpCodes._process_data_content ( self,
Any data,
str data_type )
protected
_summary_
Function in charge of processing the data content to be sent.

Args:
    data (Any): _description_: The data to be sent.
    data_type (str): _description_: The type of the data to be sent.

Returns:
    Any: _description_: The processed data.

Definition at line 140 of file http_codes.py.

◆ accepted()

Response src.lib.components.http_codes.HttpCodes.accepted ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 accepted: 202 

Definition at line 216 of file http_codes.py.

◆ already_reported()

Response src.lib.components.http_codes.HttpCodes.already_reported ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 already_reported: 208 

Definition at line 240 of file http_codes.py.

◆ bad_gateway()

Response src.lib.components.http_codes.HttpCodes.bad_gateway ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 bad_gateway: 502 

Definition at line 426 of file http_codes.py.

◆ bad_request()

Response src.lib.components.http_codes.HttpCodes.bad_request ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 bad_request: 400 

Definition at line 288 of file http_codes.py.

◆ bandwidth_limit_exceeded()

Response src.lib.components.http_codes.HttpCodes.bandwidth_limit_exceeded ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 bandwidth_limit_exceeded: 509 

Definition at line 454 of file http_codes.py.

◆ conflict()

Response src.lib.components.http_codes.HttpCodes.conflict ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 conflict: 409 

Definition at line 324 of file http_codes.py.

◆ created()

Response src.lib.components.http_codes.HttpCodes.created ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 created: 201 

Definition at line 212 of file http_codes.py.

◆ early_hints()

Response src.lib.components.http_codes.HttpCodes.early_hints ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 early_hints: 103 

Definition at line 198 of file http_codes.py.

◆ enhance_your_calm()

Response src.lib.components.http_codes.HttpCodes.enhance_your_calm ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 enhance_your_calm: 420 

Definition at line 368 of file http_codes.py.

◆ expectation_failed()

Response src.lib.components.http_codes.HttpCodes.expectation_failed ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 expectation_failed: 417 

Definition at line 356 of file http_codes.py.

◆ failed_dependency()

Response src.lib.components.http_codes.HttpCodes.failed_dependency ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 failed_dependency: 424 

Definition at line 384 of file http_codes.py.

◆ forbidden()

Response src.lib.components.http_codes.HttpCodes.forbidden ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 forbidden: 403 

Definition at line 300 of file http_codes.py.

◆ found()

Response src.lib.components.http_codes.HttpCodes.found ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 found: 302 

Definition at line 258 of file http_codes.py.

◆ gateway_timeout()

Response src.lib.components.http_codes.HttpCodes.gateway_timeout ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 gateway_timeout: 504 

Definition at line 434 of file http_codes.py.

◆ gone()

Response src.lib.components.http_codes.HttpCodes.gone ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 gone: 410 

Definition at line 328 of file http_codes.py.

◆ http_version_not_supported()

Response src.lib.components.http_codes.HttpCodes.http_version_not_supported ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 http_version_not_supported: 505 

Definition at line 438 of file http_codes.py.

◆ im_a_teapot()

Response src.lib.components.http_codes.HttpCodes.im_a_teapot ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 im_a_teapot: 418 

Definition at line 360 of file http_codes.py.

◆ im_used()

Response src.lib.components.http_codes.HttpCodes.im_used ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 im_used: 226 

Definition at line 244 of file http_codes.py.

◆ insufficient_storage()

Response src.lib.components.http_codes.HttpCodes.insufficient_storage ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 insufficient_storage: 507 

Definition at line 446 of file http_codes.py.

◆ internal_server_error()

Response src.lib.components.http_codes.HttpCodes.internal_server_error ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 internal_server_error: 500 

Definition at line 418 of file http_codes.py.

◆ invalid_token()

Response src.lib.components.http_codes.HttpCodes.invalid_token ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 invalid_token: 498 

Definition at line 412 of file http_codes.py.

◆ length_required()

Response src.lib.components.http_codes.HttpCodes.length_required ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 length_required: 411 

Definition at line 332 of file http_codes.py.

◆ locked()

Response src.lib.components.http_codes.HttpCodes.locked ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 locked: 423 

Definition at line 380 of file http_codes.py.

◆ loop_detected()

Response src.lib.components.http_codes.HttpCodes.loop_detected ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 loop_detected: 508 

Definition at line 450 of file http_codes.py.

◆ method_not_allowed()

Response src.lib.components.http_codes.HttpCodes.method_not_allowed ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 method_not_allowed: 405 

Definition at line 308 of file http_codes.py.

◆ misdirected_request()

Response src.lib.components.http_codes.HttpCodes.misdirected_request ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 misdirected_request: 421 

Definition at line 372 of file http_codes.py.

◆ moved_permanently()

Response src.lib.components.http_codes.HttpCodes.moved_permanently ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 moved_permanently: 301 

Definition at line 254 of file http_codes.py.

◆ multi_status()

Response src.lib.components.http_codes.HttpCodes.multi_status ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 multi_status: 207 

Definition at line 236 of file http_codes.py.

◆ multiple_choices()

Response src.lib.components.http_codes.HttpCodes.multiple_choices ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 multiple_choices: 300 

Definition at line 250 of file http_codes.py.

◆ network_authentication_required()

Response src.lib.components.http_codes.HttpCodes.network_authentication_required ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 network_authentication_required: 511 

Definition at line 462 of file http_codes.py.

◆ no_content()

Response src.lib.components.http_codes.HttpCodes.no_content ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 no_content: 204 

Definition at line 224 of file http_codes.py.

◆ non_authoritative_information()

Response src.lib.components.http_codes.HttpCodes.non_authoritative_information ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 non_authoritative_information: 203 

Definition at line 220 of file http_codes.py.

◆ not_acceptable()

Response src.lib.components.http_codes.HttpCodes.not_acceptable ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 not_acceptable: 406 

Definition at line 312 of file http_codes.py.

◆ not_extended()

Response src.lib.components.http_codes.HttpCodes.not_extended ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 not_extended: 510 

Definition at line 458 of file http_codes.py.

◆ not_found()

Response src.lib.components.http_codes.HttpCodes.not_found ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 not_found: 404 

Definition at line 304 of file http_codes.py.

◆ not_implemented()

Response src.lib.components.http_codes.HttpCodes.not_implemented ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 not_implemented: 501 

Definition at line 422 of file http_codes.py.

◆ not_modified()

Response src.lib.components.http_codes.HttpCodes.not_modified ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 not_modified: 304 

Definition at line 266 of file http_codes.py.

◆ page_expired()

Response src.lib.components.http_codes.HttpCodes.page_expired ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 page_expired: 419 

Definition at line 364 of file http_codes.py.

◆ partial_content()

Response src.lib.components.http_codes.HttpCodes.partial_content ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 partial_content: 206 

Definition at line 232 of file http_codes.py.

◆ payload_too_large()

Response src.lib.components.http_codes.HttpCodes.payload_too_large ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 payload_too_large: 413 

Definition at line 340 of file http_codes.py.

◆ payment_required()

Response src.lib.components.http_codes.HttpCodes.payment_required ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 payment_required: 402 

Definition at line 296 of file http_codes.py.

◆ permanent_redirect()

Response src.lib.components.http_codes.HttpCodes.permanent_redirect ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 permanent_redirect: 308 

Definition at line 282 of file http_codes.py.

◆ precondition_failed()

Response src.lib.components.http_codes.HttpCodes.precondition_failed ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 precondition_failed: 412 

Definition at line 336 of file http_codes.py.

◆ precondition_required()

Response src.lib.components.http_codes.HttpCodes.precondition_required ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 precondition_required: 428 

Definition at line 396 of file http_codes.py.

◆ processing()

Response src.lib.components.http_codes.HttpCodes.processing ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 processing: 102 

Definition at line 194 of file http_codes.py.

◆ proxy_authentication_required()

Response src.lib.components.http_codes.HttpCodes.proxy_authentication_required ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 proxy_authentication_required: 407 

Definition at line 316 of file http_codes.py.

◆ range_not_satisfiable()

Response src.lib.components.http_codes.HttpCodes.range_not_satisfiable ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 range_not_satisfiable: 416 

Definition at line 352 of file http_codes.py.

◆ request_header_fields_too_large()

Response src.lib.components.http_codes.HttpCodes.request_header_fields_too_large ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 request_header_fields_too_large: 431 

Definition at line 404 of file http_codes.py.

◆ request_timeout()

Response src.lib.components.http_codes.HttpCodes.request_timeout ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 request_timeout: 408 

Definition at line 320 of file http_codes.py.

◆ reset_content()

Response src.lib.components.http_codes.HttpCodes.reset_content ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 reset_content: 205 

Definition at line 228 of file http_codes.py.

◆ response_is_stale()

Response src.lib.components.http_codes.HttpCodes.response_is_stale ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 response_is_stale: 110 

Definition at line 202 of file http_codes.py.

◆ see_other()

Response src.lib.components.http_codes.HttpCodes.see_other ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 see_other: 303 

Definition at line 262 of file http_codes.py.

◆ send_continue()

Response src.lib.components.http_codes.HttpCodes.send_continue ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 send_continue: 100 

Definition at line 186 of file http_codes.py.

◆ send_message_on_status()

Response src.lib.components.http_codes.HttpCodes.send_message_on_status ( self,
int status = 200,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
A generic function in charge of sending a message with a status.

Args:
    status (int, optional): HTTP status code. Defaults to 200.
    content (Any, optional): The content to send. Defaults to None.
    content_type (str, optional): The type of the content. Defaults to "JSON".
    headers (Mapping[str, str], optional): The headers. Defaults to None.

Returns:
    Response: FastAPI response object.

Definition at line 157 of file http_codes.py.

◆ service_unavailable()

Response src.lib.components.http_codes.HttpCodes.service_unavailable ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 service_unavailable: 503 

Definition at line 430 of file http_codes.py.

◆ success()

Response src.lib.components.http_codes.HttpCodes.success ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 success: 200 

Definition at line 208 of file http_codes.py.

◆ switch_proxy()

Response src.lib.components.http_codes.HttpCodes.switch_proxy ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 switch_proxy: 306 

Definition at line 274 of file http_codes.py.

◆ switching_protocols()

Response src.lib.components.http_codes.HttpCodes.switching_protocols ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 switching_protocols: 101 

Definition at line 190 of file http_codes.py.

◆ temporary_redirect()

Response src.lib.components.http_codes.HttpCodes.temporary_redirect ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 temporary_redirect: 307 

Definition at line 278 of file http_codes.py.

◆ too_early()

Response src.lib.components.http_codes.HttpCodes.too_early ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 too_early: 425 

Definition at line 388 of file http_codes.py.

◆ too_many_requests()

Response src.lib.components.http_codes.HttpCodes.too_many_requests ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 too_many_requests: 429 

Definition at line 400 of file http_codes.py.

◆ unauthorized()

Response src.lib.components.http_codes.HttpCodes.unauthorized ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 unauthorized: 401 

Definition at line 292 of file http_codes.py.

◆ unavailable_for_legal_reasons()

Response src.lib.components.http_codes.HttpCodes.unavailable_for_legal_reasons ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 unavailable_for_legal_reasons: 451 

Definition at line 408 of file http_codes.py.

◆ unprocessable_entity()

Response src.lib.components.http_codes.HttpCodes.unprocessable_entity ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 unprocessable_entity: 422 

Definition at line 376 of file http_codes.py.

◆ unsupported_media_type()

Response src.lib.components.http_codes.HttpCodes.unsupported_media_type ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 unsupported_media_type: 415 

Definition at line 348 of file http_codes.py.

◆ upgrade_required()

Response src.lib.components.http_codes.HttpCodes.upgrade_required ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 upgrade_required: 426 

Definition at line 392 of file http_codes.py.

◆ uri_too_long()

Response src.lib.components.http_codes.HttpCodes.uri_too_long ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 uri_too_long: 414 

Definition at line 344 of file http_codes.py.

◆ use_proxy()

Response src.lib.components.http_codes.HttpCodes.use_proxy ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 use_proxy: 305 

Definition at line 270 of file http_codes.py.

◆ variant_also_negotiates()

Response src.lib.components.http_codes.HttpCodes.variant_also_negotiates ( self,
Any content = {'msg': 'message'},
str content_type = "JSON",
Mapping[str, str] headers = None )
 variant_also_negotiates: 506 

Definition at line 442 of file http_codes.py.

Field Documentation

◆ authorised_statuses

src.lib.components.http_codes.HttpCodes.authorised_statuses
Initial value:
= [
100, 101, 102, 103, 110,
200, 201, 202, 203, 204, 205,
206, 207, 208, 226,
300, 301, 302, 303, 304, 305,
306, 307, 308,
400, 401, 402, 403, 404, 405,
406, 407, 408, 409, 410, 411,
412, 413, 414, 415, 416, 417,
418, 419, 420, 421, 422, 423,
424, 425, 426, 428, 429, 430,
431, 451, 498,
500, 501, 502, 503, 504, 505,
506, 507, 508, 509, 510, 511
]

Definition at line 25 of file http_codes.py.

◆ data_types

dict src.lib.components.http_codes.HttpCodes.data_types

Definition at line 40 of file http_codes.py.


The documentation for this class was generated from the following file: