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

com.liveperson.faas.http.RestClient Maven / Gradle / Ivy

Go to download

Functions client for invoking lambdas via the eventsource gateway (a.k.a Asgard)

There is a newer version: 1.2.3
Show newest version
package com.liveperson.faas.http;

import java.io.IOException;
import java.util.Map;

/**
 * Rest client for communicating with the Eventsource-Gateway (a.k.a Asgard) RESTful API
 *
 * @author arotaru
 */
public interface RestClient {

    /**
     * Execute a http post call
     *
     * @param url         the url to the API endpoint
     * @param headers     the headers values map
     * @param jsonBody    the json body as string
     * @param timeOutInMs time after which request times out
     * @return response body as string
     * @throws IOException when response can not be read
     */
    String post(String url, Map headers, String jsonBody, int timeOutInMs) throws IOException;

    /**
     * Execute a http post call
     *
     * @param url      the url to the API endpoint
     * @param headers  the headers values map
     * @param jsonBody the json body as string
     * @return response body as string
     * @throws IOException when response can not be read
     */
    String post(String url, Map headers, String jsonBody) throws IOException;

    /**
     * Execute a http get call
     *
     * @param url         the url to the API endpoint
     * @param headers     the headers values map
     * @param timeOutInMs time after which request times out
     * @return response body as string
     * @throws IOException when response can not be read
     */
    String get(String url, Map headers, int timeOutInMs) throws IOException;

    /**
     * Execute a http get call
     *
     * @param url     the url to the API endpoint
     * @param headers the headers values map
     * @return response body as string
     * @throws IOException when response can not be read
     */
    String get(String url, Map headers) throws IOException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy