Class Http1xStream

  • All Implemented Interfaces:
    HttpStream


    public final class Http1xStream
    extends Object
    implements HttpStream
    A socket connection that can be used to send HTTP/1.1 messages. This class strictly enforces the following lifecycle:
    1. Send request headers.
    2. Open a sink to write the request body. Either fixed-length or chunked.
    3. Write to and then close that sink.
    4. Read response headers.
    5. Open a source to read the response body. Either fixed-length, chunked or unknown length.
    6. Read from and close that source.

    Exchanges that do not have a request body may skip creating and closing the request body. Exchanges that do not have a response body can call newFixedLengthSource(0) and may skip reading and closing that source.