001package ca.uhn.fhir.rest.client.api;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 *
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023import java.util.List;
024import java.util.Map;
025
026import org.hl7.fhir.instance.model.api.IBaseBinary;
027
028import ca.uhn.fhir.context.FhirContext;
029import ca.uhn.fhir.rest.api.EncodingEnum;
030
031/**
032 * A HTTP Client interface.
033 */
034public interface IHttpClient {
035
036    /**
037     * Create a byte request
038    * @param theContext TODO
039    * @param theContents the contents
040    * @param theContentType the contentType 
041    * @param theEncoding the encoding
042     * @return the http request to be executed
043     */
044    IHttpRequest createByteRequest(FhirContext theContext, String theContents, String theContentType, EncodingEnum theEncoding);
045
046    /**
047     * Create a parameter request
048    * @param theContext TODO
049    * @param theParams the parameters
050    * @param theEncoding the encoding
051     * @return the http request to be executed
052     */
053    IHttpRequest createParamRequest(FhirContext theContext, Map<String, List<String>> theParams, EncodingEnum theEncoding);
054
055    /**
056     * Create a binary request
057    * @param theContext TODO
058    * @param theBinary the binary
059     * @return the http request to be executed
060     */
061    IHttpRequest createBinaryRequest(FhirContext theContext, IBaseBinary theBinary);
062
063    /**
064     * Create a normal http get request
065    * @param theContext TODO
066    * @param theEncoding the request encoding
067     * @return the http request to be executed
068     */
069    IHttpRequest createGetRequest(FhirContext theContext, EncodingEnum theEncoding);
070
071}