Package 

Interface HttpCodec


  • 
    public interface HttpCodec
    
                        

    Encodes HTTP requests and decodes HTTP responses.

    • Method Summary

      Modifier and Type Method Description
      abstract Sink createRequestBody(MobonRequest mobonRequest, long contentLength) Returns an output stream where the mobonRequest body can be streamed.
      abstract void writeRequestHeaders(MobonRequest mobonRequest) This should update the HTTP engine's sentRequestMillis field.
      abstract void flushRequest() Flush the request to the underlying socket.
      abstract void finishRequest() Flush the request to the underlying socket and signal no more bytes will be transmitted.
      abstract MobonResponse.Builder readResponseHeaders(boolean expectContinue) Parses bytes of a response header from an HTTP transport.
      abstract ResponseBody openResponseBody(MobonResponse mobonResponse) Returns a stream that reads the mobonResponse body.
      abstract void cancel() Cancel this stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createRequestBody

         abstract Sink createRequestBody(MobonRequest mobonRequest, long contentLength)

        Returns an output stream where the mobonRequest body can be streamed.

      • flushRequest

         abstract void flushRequest()

        Flush the request to the underlying socket.

      • finishRequest

         abstract void finishRequest()

        Flush the request to the underlying socket and signal no more bytes will be transmitted.

      • readResponseHeaders

         abstract MobonResponse.Builder readResponseHeaders(boolean expectContinue)

        Parses bytes of a response header from an HTTP transport.

        Parameters:
        expectContinue - true to return null if this is an intermediate response with a "100"response code.
      • cancel

         abstract void cancel()

        Cancel this stream. Resources held by this stream will be cleaned up, though not synchronously.That may happen later by the connection pool thread.