type Candid = Candid.Candidtype HeaderField = (Text, Text)type HttpRequest = { url : Text; method : Text; body : Blob; headers : [HeaderField] }type StreamingToken = Candidtype StreamingResponse = { token : ?StreamingToken; body : Blob }type StreamingCallback = shared query (StreamingToken) -> async StreamingResponsetype StreamingStrategy = {#Callback : { token : StreamingToken; callback : StreamingCallback }}type HttpResponse = { status_code : Nat16; body : Blob; headers : [HeaderField]; upgrade : ?Bool; streaming_strategy : ?StreamingStrategy }type URL = { text : Text; protocol : Text; port : Nat16; host : Text; path : Text; segments : [Text]; query_map : TrieMap.TrieMap<Text, Text>; query_text : () -> Text; query_candid : () -> Blob; anchor : Text }type Form = { get : (Text) -> ?[Text]; trieMap : TrieMap.TrieMap<Text, [Text]>; keys : [Text]; fileKeys : [Text]; files : (Text) -> ?[File] }type Headers = { original : [(Text, Text)]; get : (Text) -> ?[Text]; trieMap : TrieMap.TrieMap<Text, [Text]>; keys : [Text] }type File = { name : Text; filename : Text; mimeType : Text; mimeSubType : Text; start : Nat; end : Nat; bytes : Buffer.Buffer<Nat8> }type Body = { original : Blob; size : Nat; form : Form; text : () -> Text; file : () -> ?Buffer.Buffer<Nat8>; bytes : (start : Nat, end : Nat) -> Buffer.Buffer<Nat8> }type FormObjType = { get : (Text) -> ?[Text]; trieMap : TrieMap.TrieMap<Text, [Text]>; keys : [Text]; fileKeys : [Text]; files : (Text) -> ?[File] }type ParsedHttpRequest = { method : Text; url : URL; headers : Headers; body : ?Body }type SharedMessage = { caller : Principal }type HttpHeader = { name : Text; value : Text }Canister HTTP outcall request and response types
type HttpMethod = {#get; #post; #head}type TransformContext = { function : shared query TransformArgs -> async CanisterHttpResponse; context : Blob }type CanisterHttpRequest = { url : Text; max_response_bytes : ?Nat64; headers : [HttpHeader]; body : ?[Nat8]; method : HttpMethod; transform : ?TransformContext }type CanisterHttpResponse = { status : Nat; headers : [HttpHeader]; body : [Nat8] }type RedirectedResponse = { url : Text; response : CanisterHttpResponse }type OutcallResponse = CanisterHttpResponse and { redirects : [RedirectedResponse] }type TransformArgs = { response : CanisterHttpResponse; context : Blob }type ManagementCanister = actor { http_request : shared CanisterHttpRequest -> async CanisterHttpResponse }