All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.fitko.fitconnect.api.services.http.HttpClient Maven / Gradle / Ivy

Go to download

Library that provides client access to the FIT-Connect api-endpoints for sending, subscribing and routing

There is a newer version: 2.3.5
Show newest version
package dev.fitko.fitconnect.api.services.http;

import dev.fitko.fitconnect.api.exceptions.internal.RestApiException;

import java.util.Map;

/**
 * HTTP-Service that provides basic HTTP verbs for GET, PUT and POST requests.
 */
public interface HttpClient {

    /**
     * Send HTTP GET request to a given request url.
     *
     * @param url          the URL the request is sent to
     * @param headers      map with HTTP headers
     * @param responseType the response type of the requested payload
     * @return {@link HttpResponse}
     * @throws RestApiException if an error occurred during the request
     */
     HttpResponse get(final String url, final Map headers, final Class responseType) throws RestApiException;

    /**
     * Send HTTP PUT request with payload to a given request url.
     *
     * @param url          the URL the request is sent to
     * @param headers      map with HTTP headers
     * @param httpPayload  the payload that is sent
     * @param responseType the response type of the request
     * @param 

type of the payload * @param type of the requests response * @return {@link HttpResponse} * @throws RestApiException if an error occurred during the request */ HttpResponse put(final String url, final Map headers, final P httpPayload, final Class responseType) throws RestApiException; /** * Send HTTP POST request with payload to a given request url. * * @param url the URL the request is sent to * @param headers map with HTTP headers * @param httpPayload the payload that is sent * @param responseType the response type of the request * @param

type of the payload * @param type of the requests response * @return {@link HttpResponse} * @throws RestApiException if an error occurred during the request */ HttpResponse post(final String url, final Map headers, final P httpPayload, final Class responseType) throws RestApiException; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy