aws/internal/http_streaming

Streaming HTTP send for the SDK runtime. Sits between the generated service code and the Erlang FFI in aws_streaming_ffi: translates a Gleam Request(BitArray) into the parameters httpc:request/4 expects, dispatches via the streaming FFI, then wraps the response back into a Response(StreamingBody) so call sites read identically to the buffered transport.

This is the foundational piece for S3.GetObject on multi-GB objects, event-stream operations (Transcribe, Kinesis), and any future S3 transfer manager — none of those can pre-buffer the full response into memory.

Values

pub fn default_send(
  req: request.Request(BitArray),
) -> Result(
  response.Response(streaming.StreamingBody),
  http_send.HttpError,
)

Default streaming sender. Same TLS / timeout defaults as http_send.default_send; the response body is a StreamingBody carrying chunks as they arrived on the wire. Pass this as ClientConfig.streaming_http_send for the SDK runtime, or call it directly when wiring custom callers.

pub fn default_send_http2(
  req: request.Request(BitArray),
) -> Result(
  response.Response(streaming.StreamingBody),
  http_send.HttpError,
)

HTTP/2 variant of default_send. Adds {http_version, "HTTP/2"} to the httpc option list; servers that don’t speak HTTP/2 negotiate down to HTTP/1.1 via ALPN. Use this for endpoints known to benefit: S3 multipart uploads, Bedrock streaming responses, Transcribe. Caller-facing knob lives at runtime.with_http2.

pub fn with_timeout_and_tls(
  timeout_ms timeout_ms: Int,
  verify_tls verify_tls: Bool,
) -> fn(request.Request(BitArray)) -> Result(
  response.Response(streaming.StreamingBody),
  http_send.HttpError,
)

Send a StreamingSend configurable on timeout and TLS verification. Use this for live-tested object-streaming GETs that need either fast-fail (IMDS-style 2s timeouts) or extra patience (multi-GB downloads).

pub fn with_timeout_tls_http2(
  timeout_ms timeout_ms: Int,
  verify_tls verify_tls: Bool,
) -> fn(request.Request(BitArray)) -> Result(
  response.Response(streaming.StreamingBody),
  http_send.HttpError,
)

HTTP/2 + custom timeout / TLS builder. Same as with_timeout_and_tls but adds the HTTP/2 option to the httpc call.

Search Document