Interface IRestfulClient

    • Method Detail

      • 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.
        theResourceType - The resource type to parse
        theUrl - The URL to load
        The parsed resource
      • getEncoding

        EncodingEnum getEncoding()
        Returns the encoding that will be used on requests. Default is null, 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.
        theEncoding - The encoding to use in the request, or null not specify an encoding (which generally implies the use of XML). The default is null.
      • 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!
      • 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.
        thePrettyPrint - The pretty print flag to use in the request (default is false)
      • setSummary

        void setSummary​(SummaryEnum theSummary)
        If not set to null, specifies a value for the _summary parameter to be applied globally on this client.
      • unregisterInterceptor

        void unregisterInterceptor​(Object theInterceptor)
        Remove an interceptor that was previously registered using registerInterceptor(Object).

        This is a convenience method for performing the following call: getInterceptorService().unregisterInterceptor(theInterceptor)