org.apache.hc.client5.http.protocol

## Class H2RequestPriority

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

All Implemented Interfaces:
  HttpRequestInterceptor

    @Experimental
     @Contract(threading=IMMUTABLE)
    public final class H2RequestPriority
    extends Object
    implements HttpRequestInterceptor

Adds the `Priority` request header to HTTP/2+ requests when a per-request priority is configured.

The priority is taken from `RequestConfig.getH2Priority()`. If a `Priority` header is already present on the request, it is left unchanged. If formatting the configured value yields an empty string (e.g., because it encodes protocol defaults), the header is not added.

Since:
  5.6

### Field Summary

Fields
`static H2RequestPriority` `INSTANCE` Singleton instance.

### Constructor Summary

Constructors
Constructor and Description
`H2RequestPriority()`

### Method Summary

All Methods Instance Methods Concrete Methods
`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 H2RequestPriority INSTANCE

Singleton instance.

### Constructor Detail

#### H2RequestPriority

    public H2RequestPriority()

### Method Detail

#### process

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

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