Class AdditionalRequestHeadersInterceptor


  • public class AdditionalRequestHeadersInterceptor
    extends Object
    This interceptor adds arbitrary header values to requests made by the client. This is now also possible directly on the Fluent Client API by calling IClientExecutable.withAdditionalHeader(String, String)
    • Method Detail

      • addHeaderValue

        public void addHeaderValue​(String headerName,
                                   String headerValue)
        Adds the given header value. Note that headerName and headerValue cannot be null.
        Parameters:
        headerName - the name of the header
        headerValue - the value to add for the header
        Throws:
        NullPointerException - if either parameter is null
      • addAllHeaderValues

        public void addAllHeaderValues​(String headerName,
                                       List<String> headerValues)
        Adds the list of header values for the given header. Note that headerName and headerValues cannot be null.
        Parameters:
        headerName - the name of the header
        headerValues - the list of values to add for the header
        Throws:
        NullPointerException - if either parameter is null
      • interceptRequest

        public void interceptRequest​(ca.uhn.fhir.rest.client.api.IHttpRequest theRequest)
        Adds the additional header values to the HTTP request.
        Parameters:
        theRequest - the HTTP request