org.apache.hc.client5.http.methods

## Class HttpRequestBase

- java.lang.Object
- - org.apache.hc.core5.http.message.HeaderGroup
  - - org.apache.hc.core5.http.message.AbstractHttpMessage
    - - org.apache.hc.client5.http.methods.AbstractExecutionAwareRequest
      - - org.apache.hc.client5.http.methods.HttpRequestBase

All Implemented Interfaces:
  Serializable, Configurable, HttpExecutionAware, HttpUriRequest, org.apache.hc.core5.http.HttpMessage<org.apache.hc.core5.http.HttpEntity>, org.apache.hc.core5.http.HttpRequest, org.apache.hc.core5.http.MessageHead

Direct Known Subclasses:
  HttpDelete, HttpGet, HttpHead, HttpOptions, HttpPatch, HttpPost, HttpPut, HttpTrace

    @NotThreadSafe
    public abstract class HttpRequestBase
    extends AbstractExecutionAwareRequest
    implements HttpUriRequest, Configurable

Base implementation of `HttpUriRequest`.

Since:
  4.0
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`HttpRequestBase()`

### Method Summary

Methods
`RequestConfig` `getConfig()` Returns actual request configuration.
`abstract String` `getMethod()` Returns the HTTP method this request uses, such as `GET`, `PUT`, `POST`, or other.
`org.apache.hc.core5.http.ProtocolVersion` `getProtocolVersion()`
`org.apache.hc.core5.http.RequestLine` `getRequestLine()`
`URI` `getURI()` Returns the original request URI.
`void` `releaseConnection()` A convenience method to simplify migration from HttpClient 3.1 API.
`void` `setConfig(RequestConfig config)`
`void` `setProtocolVersion(org.apache.hc.core5.http.ProtocolVersion version)`
`void` `setURI(URI uri)`
`void` `started()`
`String` `toString()`

### Methods inherited from class org.apache.hc.client5.http.methods.AbstractExecutionAwareRequest

`abort, completed, isAborted, reset, setCancellable`

### Methods inherited from class org.apache.hc.core5.http.message.AbstractHttpMessage

`addHeader, getEntity, setEntity, setHeader`

### Methods inherited from class org.apache.hc.core5.http.message.HeaderGroup

`addHeader, clear, containsHeader, containsHeaders, getAllHeaders, getCondensedHeader, getFirstHeader, getHeaders, getLastHeader, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeaders`

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

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

### Methods inherited from interface org.apache.hc.client5.http.methods.HttpUriRequest

`abort, isAborted`

### Methods inherited from interface org.apache.hc.core5.http.HttpMessage

`addHeader, addHeader, getEntity, removeHeader, removeHeaders, setEntity, setHeader, setHeader, setHeaders`

### Methods inherited from interface org.apache.hc.core5.http.MessageHead

`containsHeader, containsHeaders, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, headerIterator, headerIterator`

### Constructor Detail

#### HttpRequestBase

    public HttpRequestBase()

### Method Detail

#### getMethod

    public abstract String getMethod()

Description copied from interface: `HttpUriRequest`
Returns the HTTP method this request uses, such as `GET`, `PUT`, `POST`, or other.

Specified by:
  `getMethod` in interface `HttpUriRequest`

#### setProtocolVersion

    public void setProtocolVersion(org.apache.hc.core5.http.ProtocolVersion version)

Since:
  4.3

#### getProtocolVersion

    public org.apache.hc.core5.http.ProtocolVersion getProtocolVersion()

Specified by:
  `getProtocolVersion` in interface `org.apache.hc.core5.http.HttpMessage<org.apache.hc.core5.http.HttpEntity>`

#### getURI

    public URI getURI()

Returns the original request URI.

Please note URI remains unchanged in the course of request execution and is not updated if the request is redirected to another location.

Specified by:
  `getURI` in interface `HttpUriRequest`

#### getRequestLine

    public org.apache.hc.core5.http.RequestLine getRequestLine()

Specified by:
  `getRequestLine` in interface `org.apache.hc.core5.http.HttpRequest`

#### getConfig

    public RequestConfig getConfig()

Description copied from interface: `Configurable`
Returns actual request configuration.

Specified by:
  `getConfig` in interface `Configurable`

#### setConfig

    public void setConfig(RequestConfig config)

#### setURI

    public void setURI(URI uri)

#### started

    public void started()

Since:
  4.2

#### releaseConnection

    public void releaseConnection()

A convenience method to simplify migration from HttpClient 3.1 API. This method is equivalent to `AbstractExecutionAwareRequest.reset()`.

Since:
  4.2

#### toString

    public String toString()

Overrides:
  `toString` in class `org.apache.hc.core5.http.message.HeaderGroup`