Expand description
HTTP utilities for request/response conversion.
Functions§
- notification_
sse_ response - Converts a
NotificationStream<Response>
to anHttpResponse<Body>
so server-side events can be produced by the HTTP server. Can be useful for implementingResponseHttpConvert::to_http_response
. - notification_
sse_ stream - Converts an
HttpResponse<Body>
to aNotificationStream<Response>
so server-side events can be consumed by the HTTP client. Can be useful for implementingResponseHttpConvert::from_http_response
. - parse_
request - Deserializes the body of
HttpRequest<Body>
intoT
. Returns a “bad request” error if JSON deserialization fails, and returns an “internal” error if raw data retrieval from the request fails. Can be useful for implementingRequestHttpConvert::from_http_request
. - parse_
response - Deserializes the body of
HttpResponse<Body>
intoT
. Returns a “bad request” error if JSON deserialization fails, and returns an “internal” error if raw data retrieval from the request fails. Can be useful for implementingResponseHttpConvert::from_http_response
. - serialize_
to_ http_ request - Serializes
T
intoHttpRequest<Body>
. Returns an “internal” error if JSON serialization fails. Can be useful for implementingRequestHttpConvert::to_http_request
. - serialize_
to_ http_ response - Serializes
T
intoHttpResponse<Body>
. Returns an “internal” error if JSON serialization fails. Can be useful for implementingResponseHttpConvert::to_http_response
. - validate_
method - Compares the request method with an expected method and returns
ProtocolErrorType::HttpMethodNotAllowed
if there is a mismatch. Can be useful for implementingRequestHttpConvert::from_http_request
.