Perform a single HTTP POST request against the API for a specific action. @param action The requested API action @param body Body payload sent to the API as JSON @param tClass Type of object to be deserialized from the response JSON @return the result of the post request @throws ChainException
(String action, Object body, final Type tClass)
| 138 | * @throws ChainException |
| 139 | */ |
| 140 | public <T> T request(String action, Object body, final Type tClass) throws ChainException { |
| 141 | ResponseCreator<T> rc = |
| 142 | new ResponseCreator<T>() { |
| 143 | public T create(Response response, Gson deserializer) throws IOException { |
| 144 | return deserializer.fromJson(response.body().charStream(), tClass); |
| 145 | } |
| 146 | }; |
| 147 | return post(action, body, rc); |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Perform a single HTTP POST request against the API for a specific action, |
no test coverage detected