Class SimpleRequestHeaderInterceptor
java.lang.Object
ca.uhn.fhir.rest.client.interceptor.SimpleRequestHeaderInterceptor
- All Implemented Interfaces:
ca.uhn.fhir.rest.client.api.IClientInterceptor
public class SimpleRequestHeaderInterceptor
extends Object
implements ca.uhn.fhir.rest.client.api.IClientInterceptor
This interceptor adds an arbitrary header to requests made by this client. Both the
header name and the header value are specified by the calling code.
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructorSimpleRequestHeaderInterceptor
(String theCompleteHeader) Constructor which takes a complete header including name and valueSimpleRequestHeaderInterceptor
(String theHeaderName, String theHeaderValue) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
interceptRequest
(ca.uhn.fhir.rest.client.api.IHttpRequest theRequest) void
interceptResponse
(ca.uhn.fhir.rest.client.api.IHttpResponse theResponse) void
setHeaderName
(String theHeaderName) void
setHeaderValue
(String theHeaderValue)
-
Constructor Details
-
SimpleRequestHeaderInterceptor
public SimpleRequestHeaderInterceptor()Constructor -
SimpleRequestHeaderInterceptor
Constructor- Parameters:
theHeaderName
- The header name, e.g. "Authorization
"theHeaderValue
- The header value, e.g. "Bearer 09uer90uw9yh
"
-
SimpleRequestHeaderInterceptor
Constructor which takes a complete header including name and value- Parameters:
theCompleteHeader
- The complete header, e.g. "Authorization: Bearer af09ufe90efh
". Must not be null or empty.
-
-
Method Details
-
getHeaderName
-
getHeaderValue
-
interceptRequest
- Specified by:
interceptRequest
in interfaceca.uhn.fhir.rest.client.api.IClientInterceptor
-
interceptResponse
public void interceptResponse(ca.uhn.fhir.rest.client.api.IHttpResponse theResponse) throws IOException - Specified by:
interceptResponse
in interfaceca.uhn.fhir.rest.client.api.IClientInterceptor
- Throws:
IOException
-
setHeaderName
-
setHeaderValue
-