Package com.github.katenachain.api
Class Client
- java.lang.Object
-
- com.github.katenachain.api.Client
-
public class Client extends Object
Client is a okhttp3.OkHttpClient 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, byte[] body)wraps the doRequest method to do a POST HTTP request.RawResponsepost(String route, byte[] 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-
-
-
Method Detail
-
get
public RawResponse get(String route) throws IOException
wraps the doRequest method to do a GET HTTP request.- Parameters:
route-- Returns:
- Throws:
IOException
-
get
public RawResponse get(String route, HashMap<String,String> queryValues) throws IOException
wraps the doRequest method to do a GET HTTP request.- Parameters:
route-queryValues-- Returns:
- Throws:
IOException
-
post
public RawResponse post(String route, byte[] body) throws IOException
wraps the doRequest method to do a POST HTTP request.- Parameters:
route-body-- Returns:
- Throws:
IOException
-
post
public RawResponse post(String route, byte[] body, HashMap<String,String> queryValues) throws IOException
wraps the doRequest method to do a POST HTTP request.- Parameters:
body-route-queryValues-- Returns:
- Throws:
IOException
-
-