Interface Body


  • public interface Body
    Handles the HTTP proxy body.

    Author:
    Julien Viet
    • Method Detail

      • body

        static Body body​(ReadStream<Buffer> stream,
                         long len)
        Create a new Body instance.
        Parameters:
        stream - the ReadStream of the body
        len - the determined length of the body
        Returns:
        a reference to this, so the API can be used fluently
      • body

        static Body body​(ReadStream<Buffer> stream)
        Create a new Body instance.
        Parameters:
        stream - the ReadStream of the body
        Returns:
        a reference to this, so the API can be used fluently
      • body

        static Body body​(Buffer buffer)
        Create a new Body instance.
        Parameters:
        buffer - the Buffer of the body
        Returns:
        a reference to this, so the API can be used fluently
      • length

        long length()
        Get length of the Body.
        Returns:
        the body length or -1 if that can't be determined
      • stream

        ReadStream<Buffer> stream()
        Get stream of the Body.
        Returns:
        the body stream