Net.HTTP.Payload
A request body as the client sends it: whether it can be sent again, and
a function that makes the Stream to send each time. The client sends a
ClientRequest Payload; the Body instances (Net.HTTP.Body) make one
with text, bytes, file, incoming and stream.
Sent again. A String and a Buffer are held, and a File is read
from offset 0 by readAt each time it is sent, so it never depends on the
file's position: each of these can be sent again. An Incoming and a
Stream are read as they are written, once, and cannot. The client's
retry and redirect rules send a request again only when its body is
replayable.
The length is sent as Content-Length: a String's and a Buffer's
size, the size stat returns for a File when the request is sent, an
Incoming's declared length, and a Stream's own. A body with none goes
chunked. A file that then grows or shrinks while it is written fails the
request (Overrun or Truncated) rather than sending other bytes than
the length declared.
open is called once per send, before the head is written, and the
stream it returns is sent once.
Returns whether the body can be sent again.
Returns whether the body is a received one whose sender waits for a
100 Continue that reading it will send, so that the request carrying it
should ask its own server for one first.
Returns the stream that sends the body this time, or why there is none: a file that cannot be measured.
Returns s's UTF-8 bytes as a body.
Returns b's window, as it is now, as a body. The buffer is never
consumed, so a send again sends the same bytes.
Returns f's contents as a body, read from offset 0 each time it is sent.
Returns a body that arrived, passed on as it is read: the length its framing declared, if any, the bytes as they come, with no limit of their own, and its trailers. It can be sent once.
Returns s as a body. It can be sent once.