Package ca.uhn.fhir.rest.client.api
Interface IRestfulClient
-
- All Known Subinterfaces:
IBasicClient,IGenericClient
public interface IRestfulClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends IBaseResource>
TfetchResourceFromUrl(Class<T> theResourceType, String theUrl)Retrieve the contents at the given URL and parse them as a resource.EncodingEnumgetEncoding()Returns the encoding that will be used on requests.FhirContextgetFhirContext()Returns the FHIR context associated with this clientIHttpClientgetHttpClient()Do not call this method in client code.IInterceptorServicegetInterceptorService()Sets the interfceptor service used by this clientStringgetServerBase()Base URL for the server, with no trailing "/"voidregisterInterceptor(Object theInterceptor)Register a new interceptor for this client.voidsetEncoding(EncodingEnum theEncoding)Specifies that the client should use the given encoding to do its queries.voidsetFormatParamStyle(RequestFormatParamStyleEnum theRequestFormatParamStyle)Configures what style of _format parameter should be used in requestsvoidsetInterceptorService(IInterceptorService theInterceptorService)Sets the interfceptor service used by this clientvoidsetPrettyPrint(Boolean thePrettyPrint)Specifies that the client should request that the server respond with "pretty printing" enabled.voidsetSummary(SummaryEnum theSummary)If not set tonull, specifies a value for the_summaryparameter to be applied globally on this client.voidunregisterInterceptor(Object theInterceptor)Remove an interceptor that was previously registered usingregisterInterceptor(Object).
-
-
-
Method Detail
-
getInterceptorService
IInterceptorService getInterceptorService()
Sets the interfceptor service used by this client- Since:
- 3.8.0
-
setInterceptorService
void setInterceptorService(@Nonnull IInterceptorService theInterceptorService)
Sets the interfceptor service used by this client- Since:
- 3.8.0
-
fetchResourceFromUrl
<T extends IBaseResource> T fetchResourceFromUrl(Class<T> theResourceType, String theUrl)
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
EncodingEnum 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
void setEncoding(EncodingEnum theEncoding)
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, ornullnot specify an encoding (which generally implies the use of XML). The default isnull.
-
getFhirContext
FhirContext getFhirContext()
Returns the FHIR context associated with this client
-
getHttpClient
IHttpClient getHttpClient()
Do not call this method in client code. It is a part of the internal HAPI API and is subject to change!
-
getServerBase
String getServerBase()
Base URL for the server, with no trailing "/"
-
registerInterceptor
void registerInterceptor(Object theInterceptor)
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
void setPrettyPrint(Boolean thePrettyPrint)
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
void setSummary(SummaryEnum theSummary)
If not set tonull, specifies a value for the_summaryparameter to be applied globally on this client.
-
unregisterInterceptor
void unregisterInterceptor(Object theInterceptor)
Remove an interceptor that was previously registered usingregisterInterceptor(Object).This is a convenience method for performing the following call:
getInterceptorService().unregisterInterceptor(theInterceptor)
-
setFormatParamStyle
void setFormatParamStyle(RequestFormatParamStyleEnum theRequestFormatParamStyle)
Configures what style of _format parameter should be used in requests
-
-