package awskit

  1. Overview
  2. Docs
AWS infrastructure — signing, credentials, endpoints, and core types

Install

dune-project
 Dependency

Authors

Maintainers

Sources

awskit-v0.2.0.tbz
sha256=b69c81378d08f443a276b947d9a2b45913495cb61b2ff3aa0ad74d6b071f32f8
sha512=50714b8eda6ea6e589eb34a305afdfa4870a5e8e4240c091ff5cecd309c21fdfda6163fb6449caad5cdaf800857369df5da0534d822cf152ac76fc16fb9216e5

doc/awskit/Awskit/Response/index.html

Module Awskit.ResponseSource

Body-free HTTP response metadata.

Body-free HTTP response metadata.

Runtime adapters keep the response body separate and expose it only through scoped readers. This record contains status, headers, and AWS request ids that are useful after the body has been consumed.

Sourcetype t = private {
  1. status : int;
  2. headers : (string * string) list;
  3. request_id : string option;
  4. host_id : string option;
}
Sourceval create : status:int -> ?headers:(string * string) list -> unit -> (t, Error.t) result

Create response metadata from an HTTP status and raw headers. AWS request id fields are extracted from standard S3/AWS headers when present.

Sourceval create_exn : status:int -> ?headers:(string * string) list -> unit -> t

Like create, but raises Error.Awskit_error carrying the structured validation error on validation failure.

Sourceval status : t -> int

Return the HTTP status code.

Sourceval headers : t -> (string * string) list

Return response headers in their stored order.

Sourceval header : t -> string -> string option

Look up a header case-insensitively.

Sourceval required_header : t -> string -> (string, Error.t) result

Return a header or a decode error when it is absent.

Sourceval header_int : t -> string -> (int option, Error.t) result

Parse an optional integer header. Invalid integer text is a decode error.

Sourceval header_int64 : t -> string -> (int64 option, Error.t) result

Parse an optional 64-bit integer header. Invalid integer text is a decode error.

Sourceval is_success : t -> bool

true for HTTP 2xx statuses.

Sourceval request_id : t -> string option

Return the AWS request id, when present.

Sourceval host_id : t -> string option

Return the extended AWS host id, when present.