HeaderField is the type of the header of the request.
HttpRequest is the request type that is available in handler.
It is a more user-friendly version of RawHttpRequest
It is used in handler to allow user to process the request.
HttpResponse is the response type that is available in handler.
It is a more user-friendly version of RawHttpResponse
After the handler is executed, it is converted to RawHttpResponse.
HttpServe is the main struct of the Pluto library.
It is used to create a new instance of HttpServe.
It is used in the ‘http_request’ and ‘http_request_update’ function of the canister.
This struct handles routing from not upgradable request to upgradable request.
It also handles CORS.
RawHttpRequest is the request type that is sent by the client.
It is a raw version of HttpRequest. It is compatible with the Candid type.
It is used in the ‘http_request’ and ‘http_request_update’ function of the canister and it is provided by the IC.
It is converted to HttpRequest before it is used in the handler.
RawHttpResponse is the response type that is sent back to the client.
It is a raw version of HttpResponse. It is compatible with the Candid type.