View Javadoc
1   package ca.uhn.fhir.rest.client.api;
2   
3   /*
4    * #%L
5    * HAPI FHIR - Core Library
6    * %%
7    * Copyright (C) 2014 - 2018 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import java.util.List;
24  import java.util.Map;
25  
26  import org.hl7.fhir.instance.model.api.IBaseBinary;
27  
28  import ca.uhn.fhir.context.FhirContext;
29  import ca.uhn.fhir.rest.api.EncodingEnum;
30  
31  /**
32   * A HTTP Client interface.
33   */
34  public interface IHttpClient {
35  
36      /**
37       * Create a byte request
38      * @param theContext TODO
39      * @param theContents the contents
40      * @param theContentType the contentType 
41      * @param theEncoding the encoding
42       * @return the http request to be executed
43       */
44      IHttpRequest createByteRequest(FhirContext theContext, String theContents, String theContentType, EncodingEnum theEncoding);
45  
46      /**
47       * Create a parameter request
48      * @param theContext TODO
49      * @param theParams the parameters
50      * @param theEncoding the encoding
51       * @return the http request to be executed
52       */
53      IHttpRequest createParamRequest(FhirContext theContext, Map<String, List<String>> theParams, EncodingEnum theEncoding);
54  
55      /**
56       * Create a binary request
57      * @param theContext TODO
58      * @param theBinary the binary
59       * @return the http request to be executed
60       */
61      IHttpRequest createBinaryRequest(FhirContext theContext, IBaseBinary theBinary);
62  
63      /**
64       * Create a normal http get request
65      * @param theContext TODO
66      * @param theEncoding the request encoding
67       * @return the http request to be executed
68       */
69      IHttpRequest createGetRequest(FhirContext theContext, EncodingEnum theEncoding);
70  
71  }