Package ca.uhn.fhir.rest.client.api
Interface IRestfulClient
- All Known Subinterfaces:
IBasicClient
,IGenericClient
public interface IRestfulClient
-
Method Summary
Modifier and TypeMethodDescription<T extends IBaseResource>
TfetchResourceFromUrl
(Class<T> theResourceType, String theUrl) Retrieve the contents at the given URL and parse them as a resource.Returns the encoding that will be used on requests.Returns the FHIR context associated with this clientDo not call this method in client code.Sets the interfceptor service used by this clientBase URL for the server, with no trailing "/"void
registerInterceptor
(Object theInterceptor) Register a new interceptor for this client.void
setEncoding
(EncodingEnum theEncoding) Specifies that the client should use the given encoding to do its queries.void
setFormatParamStyle
(RequestFormatParamStyleEnum theRequestFormatParamStyle) Configures what style of _format parameter should be used in requestsvoid
setInterceptorService
(IInterceptorService theInterceptorService) Sets the interfceptor service used by this clientvoid
setPrettyPrint
(Boolean thePrettyPrint) Specifies that the client should request that the server respond with "pretty printing" enabled.void
setSummary
(SummaryEnum theSummary) If not set tonull
, specifies a value for the_summary
parameter to be applied globally on this client.void
unregisterInterceptor
(Object theInterceptor) Remove an interceptor that was previously registered usingregisterInterceptor(Object)
.
-
Method Details
-
getInterceptorService
Sets the interfceptor service used by this client- Since:
- 3.8.0
-
setInterceptorService
Sets the interfceptor service used by this client- Since:
- 3.8.0
-
fetchResourceFromUrl
Retrieve the contents at the given URL and parse them as a resource. This method could be used as a low level implementation of a read/vread/search operation.- Parameters:
theResourceType
- The resource type to parsetheUrl
- The URL to load- Returns:
- The parsed resource
-
getEncoding
Returns the encoding that will be used on requests. Default isnull
, which means the client will not explicitly request an encoding. (This is standard behaviour according to the FHIR specification) -
setEncoding
Specifies that the client should use the given encoding to do its queries. This means that the client will append the "_format" param to GET methods (read/search/etc), and will add an appropriate header for write methods.- Parameters:
theEncoding
- The encoding to use in the request, ornull
not specify an encoding (which generally implies the use of XML). The default isnull
.
-
getFhirContext
Returns the FHIR context associated with this client -
getHttpClient
Do not call this method in client code. It is a part of the internal HAPI API and is subject to change! -
getServerBase
Base URL for the server, with no trailing "/" -
registerInterceptor
Register a new interceptor for this client. An interceptor can be used to add additional logging, or add security headers, or pre-process responses, etc.This is a convenience method for performing the following call:
getInterceptorService().registerInterceptor(theInterceptor)
-
setPrettyPrint
Specifies that the client should request that the server respond with "pretty printing" enabled. Note that this is a non-standard parameter, not all servers will support it.- Parameters:
thePrettyPrint
- The pretty print flag to use in the request (default isfalse
)
-
setSummary
If not set tonull
, specifies a value for the_summary
parameter to be applied globally on this client. -
unregisterInterceptor
Remove an interceptor that was previously registered usingregisterInterceptor(Object)
.This is a convenience method for performing the following call:
getInterceptorService().unregisterInterceptor(theInterceptor)
-
setFormatParamStyle
Configures what style of _format parameter should be used in requests
-