From 3c3de46886f95c371e86112597787f2b4d70718d Mon Sep 17 00:00:00 2001 From: Igor Balos Date: Mon, 19 Dec 2022 13:20:49 +0100 Subject: [PATCH] copy changes --- .../com/postmarkapp/postmark/client/HttpClient.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/postmarkapp/postmark/client/HttpClient.java b/src/main/java/com/postmarkapp/postmark/client/HttpClient.java index a32302f..68244b2 100644 --- a/src/main/java/com/postmarkapp/postmark/client/HttpClient.java +++ b/src/main/java/com/postmarkapp/postmark/client/HttpClient.java @@ -56,9 +56,8 @@ public HttpClient(MultivaluedMap headers) { * @return response from HTTP request */ public ClientResponse execute(REQUEST_TYPES requestType, String url, String data) { - String httpUrl = getSecureUrl(url); Response response; - WebTarget target = client.target(httpUrl); + WebTarget target = client.target(getHttpUrl(url)); switch (requestType) { case POST: @@ -90,7 +89,7 @@ public ClientResponse execute(REQUEST_TYPES requestType, String url, String data } - return prettifyResponse(response); + return transformResponse(response); } /** @@ -120,7 +119,7 @@ public void setSecureConnection(boolean secureConnection) { this.secureConnection = secureConnection; } - private String getSecureUrl(String url) { + private String getHttpUrl(String url) { String urlPrefix = this.secureConnection ? "https://" : "http://"; return urlPrefix + url; } @@ -140,7 +139,7 @@ public Client getClient() { * @param response HTTP request response result * @return simplified HTTP request response */ - private ClientResponse prettifyResponse(Response response) { + private ClientResponse transformResponse(Response response) { return new ClientResponse(response.getStatus(), response.readEntity(String.class)); } @@ -175,5 +174,4 @@ public enum REQUEST_TYPES { PATCH, DELETE } - }