
Class AdditionalRequestHeadersInterceptor
java.lang.Object
ca.uhn.fhir.rest.client.interceptor.AdditionalRequestHeadersInterceptor
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)-
Constructor Summary
ConstructorsConstructorDescriptionConstructorAdditionalRequestHeadersInterceptor(Map<String, List<String>> theHeaders) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllHeaderValues(String headerName, List<String> headerValues) Adds the list of header values for the given header.voidaddHeaderValue(String headerName, String headerValue) Adds the given header value.voidinterceptRequest(ca.uhn.fhir.rest.client.api.IHttpRequest theRequest) Adds the additional header values to the HTTP request.
-
Constructor Details
-
AdditionalRequestHeadersInterceptor
public AdditionalRequestHeadersInterceptor()Constructor -
AdditionalRequestHeadersInterceptor
Constructor- Parameters:
theHeaders- The additional headers to add to every request
-
-
Method Details
-
addHeaderValue
Adds the given header value. Note thatheaderNameandheaderValuecannot be null.- Parameters:
headerName- the name of the headerheaderValue- the value to add for the header- Throws:
NullPointerException- if either parameter isnull
-
addAllHeaderValues
Adds the list of header values for the given header. Note thatheaderNameandheaderValuescannot be null.- Parameters:
headerName- the name of the headerheaderValues- the list of values to add for the header- Throws:
NullPointerException- if either parameter isnull
-
interceptRequest
Adds the additional header values to the HTTP request.- Parameters:
theRequest- the HTTP request
-