Search in sources :

Example 6 with Response

use of cc.protea.util.http.Response in project java-sdk by hyperwallet.

the class HyperwalletApiClient method post.

public <T> T post(final String url, final Object bodyObject, final Class<T> type) {
    Response response = null;
    try {
        Request request = getService(url, false);
        String body = bodyObject != null ? encrypt(convert(bodyObject)) : "";
        request.setBody(body);
        response = request.postResource();
        return processResponse(response, type);
    } catch (IOException | JOSEException | ParseException e) {
        throw new HyperwalletException(e);
    }
}
Also used : Response(cc.protea.util.http.Response) HyperwalletException(com.hyperwallet.clientsdk.HyperwalletException) IOException(java.io.IOException) ParseException(java.text.ParseException) JOSEException(com.nimbusds.jose.JOSEException)

Aggregations

Response (cc.protea.util.http.Response)6 HyperwalletException (com.hyperwallet.clientsdk.HyperwalletException)4 IOException (java.io.IOException)4 JOSEException (com.nimbusds.jose.JOSEException)3 ParseException (java.text.ParseException)3 BinaryResponse (cc.protea.util.http.BinaryResponse)1 HttpResponse (org.mockserver.model.HttpResponse)1 Test (org.testng.annotations.Test)1