R.Request_bodytype 'a io = 'a ttype t = request_bodyRuntime-owned request body value.
type writer = request_body_writerScoped request-body writer passed only to of_stream callbacks.
val empty : tEmpty replayable body.
val of_string : string -> tReplayable body backed by a string.
val of_bytes : bytes -> tReplayable body backed by bytes.
val of_stream :
Awskit.Body.Request.descriptor ->
write:(writer -> (unit, Awskit.Error.t) Stdlib.result io) ->
tStreaming body backed by a writer callback.
The descriptor must accurately describe the stream. Mark the body as replayable only if calling write again sends the same bytes. Runtime adapters may call write once per retry attempt, and may cancel it when the request attempt is abandoned or times out.
val descriptor : t -> Awskit.Body.Request.descriptorReturn the signing and retry metadata for a request body.
val content_length : t -> int64 optionReturn the declared body length, when known.
val write_string : writer -> string -> (unit, Awskit.Error.t) Stdlib.result ioWrite a chunk to a streaming request body. The writer is valid only during the of_stream callback invocation.
val write_bytes : writer -> bytes -> (unit, Awskit.Error.t) Stdlib.result ioWrite a bytes chunk to a streaming request body. The writer is valid only during the of_stream callback invocation.
val write_subbytes :
writer ->
bytes ->
off:int ->
len:int ->
(unit, Awskit.Error.t) Stdlib.result ioWrite a bounded bytes slice to a streaming request body. Invalid bounds return Error Body.