Class HttpTransport

java.lang.Object
com.squareup.okhttp.internal.http.HttpTransport

public final class HttpTransport
extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • createRequestBody

      public OutputStream createRequestBody() throws IOException
      Throws:
      IOException
    • flushRequest

      public void flushRequest() throws IOException
      Throws:
      IOException
    • writeRequestBody

      public void writeRequestBody​(com.squareup.okhttp.internal.http.RetryableOutputStream requestBody) throws IOException
      Throws:
      IOException
    • writeRequestHeaders

      public void writeRequestHeaders() throws IOException
      Prepares the HTTP headers and sends them to the server.

      For streaming requests with a body, headers must be prepared before the output stream has been written to. Otherwise the body would need to be buffered!

      For non-streaming requests with a body, headers must be prepared after the output stream has been written to and closed. This ensures that the Content-Length header field receives the proper value.

      Throws:
      IOException
    • readResponseHeaders

      public ResponseHeaders readResponseHeaders() throws IOException
      Throws:
      IOException
    • makeReusable

      public boolean makeReusable​(boolean streamCancelled, OutputStream requestBodyOut, InputStream responseBodyIn)
    • getTransferStream

      public InputStream getTransferStream​(CacheRequest cacheRequest) throws IOException
      Throws:
      IOException