Package cz.diribet.chystat.api.client
Interface IApiClient
-
- All Known Implementing Classes:
ChystatApiClient,OkHttpApiClient
public interface IApiClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResponsePayloaddelete(String path)Executes DELETE request and returns response if the request was successful [200..300).ResponsePayloadget(String path)Executes GET request and returns response if the request was successful [200..300).ResponsePayloadpatch(String path, Object payload)Executes PATCH request and returns response if the request was successful [200..300).ResponsePayloadpost(String path, Object payload)Executes POST request and returns response if the request was successful [200..300).ResponsePayloadput(String path, Object payload)Executes PUT request and returns response if the request was successful [200..300).
-
-
-
Method Detail
-
get
ResponsePayload get(String path) throws IOException, InvalidResponseException
Executes GET request and returns response if the request was successful [200..300).- Parameters:
path-- Returns:
- Throws:
IOException- if there was some problem during request executionInvalidResponseException- if the response code was different to [200..300)
-
post
ResponsePayload post(String path, Object payload) throws IOException, InvalidResponseException
Executes POST request and returns response if the request was successful [200..300).- Parameters:
path-payload-- Returns:
- Throws:
IOException- if there was some problem during request executionInvalidResponseException- if the response code was different to [200..300)
-
put
ResponsePayload put(String path, Object payload) throws IOException, InvalidResponseException
Executes PUT request and returns response if the request was successful [200..300).- Parameters:
path-payload-- Returns:
- Throws:
IOException- if there was some problem during request executionInvalidResponseException- if the response code was different to [200..300)
-
patch
ResponsePayload patch(String path, Object payload) throws IOException, InvalidResponseException
Executes PATCH request and returns response if the request was successful [200..300).- Parameters:
path-payload-- Returns:
- Throws:
IOException- if there was some problem during request executionInvalidResponseException- if the response code was different to [200..300)
-
delete
ResponsePayload delete(String path) throws IOException, InvalidResponseException
Executes DELETE request and returns response if the request was successful [200..300).- Parameters:
path-- Returns:
- Throws:
IOException- if there was some problem during request executionInvalidResponseException- if the response code was different to [200..300)
-
-