morpheus.utils.http_utils.HttpParseResponse#
- class HttpParseResponse(
- status_code,
- content_type,
- body,
- on_complete_callback=None,
Bases:
NamedTupleA tuple consisting of the HTTP status code, mime type to be used for the Content-Type header, the body of the response and an optional callback function to be invoked once the response is completed.
The values for
status_codeandcontent_typeare strings rather thanhttp.HTTPStatusandMimeTypesbecause these are intended to be consumed directly by the C++ implementation ofmorpheus.common.HttpServer. Instead these enums should be used to constructHttpParseResponseinstances:>>> http_parse_response = HttpParseResponse(status_code=HTTPStatus.OK.value, ... content_type=MimeTypes.TEXT.value, ... body="OK", ... on_complete_callback=None) >>>
- Attributes:
- body
Alias for field number 2
- content_type
Alias for field number 1
- on_complete_callback
Alias for field number 3
- status_code
Alias for field number 0
Methods
count(value, /)Return number of occurrences of value.
index(value[, start, stop])Return first index of value.
- count(value, /)#
Return number of occurrences of value.
- index(value, start=0, stop=sys.maxsize, /)#
Return first index of value.
Raises ValueError if the value is not present.