Package com.github.katenachain.api
Class Client
- java.lang.Object
-
- com.github.katenachain.api.Client
-
public class Client extends Object
Client is a wrapper to dialog with a JSON API.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RawResponseget(String route)wraps the doRequest method to do a GET HTTP request.RawResponseget(String route, HashMap<String,String> queryValues)wraps the doRequest method to do a GET HTTP request.RawResponsepost(String route, String body)wraps the doRequest method to do a POST HTTP request.RawResponsepost(String route, String body, HashMap<String,String> queryValues)wraps the doRequest method to do a POST HTTP request.
-
-
-
Constructor Detail
-
Client
public Client(String apiUrl)
Client constructor.- Parameters:
apiUrl- String
-
-
Method Detail
-
get
public RawResponse get(String route) throws IOException
wraps the doRequest method to do a GET HTTP request.- Parameters:
route- String- Returns:
- RawResponse raw response
- Throws:
IOException- the io exception
-
get
public RawResponse get(String route, HashMap<String,String> queryValues) throws IOException
wraps the doRequest method to do a GET HTTP request.- Parameters:
route- StringqueryValues- HashMap- Returns:
- RawResponse raw response
- Throws:
IOException- the io exception
-
post
public RawResponse post(String route, String body) throws IOException
wraps the doRequest method to do a POST HTTP request.- Parameters:
route- Stringbody- String- Returns:
- RawResponse raw response
- Throws:
IOException- the io exception
-
post
public RawResponse post(String route, String body, HashMap<String,String> queryValues) throws IOException
wraps the doRequest method to do a POST HTTP request.- Parameters:
route- Stringbody- StringqueryValues- HashMap- Returns:
- RawResponse raw response
- Throws:
IOException- the io exception
-
-