Package com.liveperson.faas.http
Interface RestClient
-
- All Known Implementing Classes:
DefaultRestClient
public interface RestClientRest client for communicating with the Eventsource-Gateway (a.k.a Asgard) RESTful API- Author:
- arotaru
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringget(String url, Map<String,String> headers)Execute a http get callStringget(String url, Map<String,String> headers, int timeOutInMs)Execute a http get callStringpost(String url, Map<String,String> headers, String jsonBody)Execute a http post callStringpost(String url, Map<String,String> headers, String jsonBody, int timeOutInMs)Execute a http post call
-
-
-
Method Detail
-
post
String post(String url, Map<String,String> headers, String jsonBody, int timeOutInMs) throws IOException
Execute a http post call- Parameters:
url- the url to the API endpointheaders- the headers values mapjsonBody- the json body as stringtimeOutInMs- time after which request times out- Returns:
- response body as string
- Throws:
IOException- when response can not be read
-
post
String post(String url, Map<String,String> headers, String jsonBody) throws IOException
Execute a http post call- Parameters:
url- the url to the API endpointheaders- the headers values mapjsonBody- the json body as string- Returns:
- response body as string
- Throws:
IOException- when response can not be read
-
get
String get(String url, Map<String,String> headers, int timeOutInMs) throws IOException
Execute a http get call- Parameters:
url- the url to the API endpointheaders- the headers values maptimeOutInMs- time after which request times out- Returns:
- response body as string
- Throws:
IOException- when response can not be read
-
get
String get(String url, Map<String,String> headers) throws IOException
Execute a http get call- Parameters:
url- the url to the API endpointheaders- the headers values map- Returns:
- response body as string
- Throws:
IOException- when response can not be read
-
-