org.apache.hc.core5.http.impl.io

## Class DefaultHttpRequestWriter

- java.lang.Object
- - org.apache.hc.core5.http.impl.io.AbstractMessageWriter<ClassicHttpRequest>
  - - org.apache.hc.core5.http.impl.io.DefaultHttpRequestWriter

- All Implemented Interfaces:
    HttpMessageWriter<ClassicHttpRequest>

      public class DefaultHttpRequestWriter
      extends AbstractMessageWriter<ClassicHttpRequest>

  HTTP request writer that serializes its output to an instance of `SessionOutputBuffer`.
  Since:
    4.3

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultHttpRequestWriter()`
    `DefaultHttpRequestWriter(Http1Config http1Config, LineFormatter formatter)`
    `DefaultHttpRequestWriter(LineFormatter formatter)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected HttpVersion` | `protocolVersion(HttpRequest message)` Determines the HTTP protocol version to be communicated to the opposite endpoint in the message header.
    `protected void` | `writeHeadLine(ClassicHttpRequest message, CharArrayBuffer lineBuf)` Subclasses must override this method to write out the first header line based on the `HttpMessage` passed as a parameter.

    - ### Methods inherited from class org.apache.hc.core5.http.impl.io.AbstractMessageWriter

      `write`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultHttpRequestWriter

          public DefaultHttpRequestWriter(Http1Config http1Config,
                                          LineFormatter formatter)

      Since:
        5.3

    - #### DefaultHttpRequestWriter

          public DefaultHttpRequestWriter(LineFormatter formatter)

    - #### DefaultHttpRequestWriter

          public DefaultHttpRequestWriter()

  - ### Method Detail

    - #### protocolVersion

          protected HttpVersion protocolVersion(HttpRequest message)

      Determines the HTTP protocol version to be communicated to the opposite endpoint in the message header.
      Since:
        5.3

    - #### writeHeadLine

          protected void writeHeadLine(ClassicHttpRequest message,
                                       CharArrayBuffer lineBuf)
                                throws IOException

      Description copied from class: `AbstractMessageWriter`
      Subclasses must override this method to write out the first header line based on the `HttpMessage` passed as a parameter.
      Specified by:
        `writeHeadLine` in class `AbstractMessageWriter<ClassicHttpRequest>`
      Parameters:
        `message` - the message whose first line is to be written out.
        `lineBuf` - line buffer
      Throws:
        `IOException` - in case of an I/O error.

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.