org.apache.hc.client5.http.protocol

## Class RequestDefaultHeaders

- java.lang.Object
- - org.apache.hc.client5.http.protocol.RequestDefaultHeaders

- All Implemented Interfaces:
    HttpRequestInterceptor

      @Contract(threading=STATELESS)
      public class RequestDefaultHeaders
      extends Object
      implements HttpRequestInterceptor

  Request interceptor that adds default request headers.
  Since:
    4.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static RequestDefaultHeaders` | `INSTANCE` Singleton instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequestDefaultHeaders()`
    `RequestDefaultHeaders(Collection<? extends Header> defaultHeaders)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `process(HttpRequest request, EntityDetails entity, HttpContext context)`

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

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

- - ### Field Detail

    - #### INSTANCE

          public static final RequestDefaultHeaders INSTANCE

      Singleton instance.
      Since:
        5.2

  - ### Constructor Detail

    - #### RequestDefaultHeaders

          public RequestDefaultHeaders(Collection<? extends Header> defaultHeaders)

      Since:
        4.3

    - #### RequestDefaultHeaders

          public RequestDefaultHeaders()

  - ### Method Detail

    - #### process

          public void process(HttpRequest request,
                              EntityDetails entity,
                              HttpContext context)
                       throws HttpException,
                              IOException

      Specified by:
        `process` in interface `HttpRequestInterceptor`
      Throws:
        `HttpException`
        `IOException`

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