Class H2RequestPriority

java.lang.Object
org.apache.hc.client5.http.protocol.H2RequestPriority
All Implemented Interfaces:
org.apache.hc.core5.http.HttpRequestInterceptor

@Experimental @Contract(threading=IMMUTABLE) public final class H2RequestPriority extends Object implements org.apache.hc.core5.http.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 Details

  • Constructor Details

    • H2RequestPriority

      public H2RequestPriority()
  • Method Details

    • process

      public void process(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.EntityDetails entity, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException, IOException
      Specified by:
      process in interface org.apache.hc.core5.http.HttpRequestInterceptor
      Throws:
      org.apache.hc.core5.http.HttpException
      IOException