Lwt IO implementation that uses strings to marshal and unmarshal HTTP
IO interface that uses
buf for input data and queues output data into a
Buffer.t. Never actually blocks despite the Lwt use, although a future revision may yield when parsing large strings.
with type 'a t = 'a Lwt.t
and type ic = Cohttp.Private.String_io.buf
and type oc = Stdlib.Buffer.t
type 'a t = 'a Lwt.t
'a t represents a blocking monad state
a >>= b will pass the result of
a to the
b function. This is a monadic
val return : 'a -> 'a t
return a will construct a constant IO value.
type ic = Cohttp.Private.String_io.buf
ic represents an input channel
val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
read_line ic will read a single line terminated by CR or CRLF from the input channel
ic. It returns
None if EOF or other error condition is reached.
read ic len will block until a maximum of
len characters are read from the input channel
ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than
len characters if input buffering is not sufficient to satisfy the request.
write oc s will block until the complete
s string is written to the output channel