Class HttpEntityUtil
java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.HttpEntityUtil
Util class extracting the entity of an
HttpResponse
, unzipping it if necessary, and finally consuming the
response.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getResponseBody
(org.apache.http.HttpResponse response) Extracts the body string using UTF-8 and consumes theHttpEntity
.
-
Constructor Details
-
HttpEntityUtil
public HttpEntityUtil()
-
-
Method Details
-
getResponseBody
@Nullable public static String getResponseBody(@Nonnull org.apache.http.HttpResponse response) throws IOException, org.apache.http.ParseException Extracts the body string using UTF-8 and consumes theHttpEntity
.- Parameters:
response
- The response to extract the entity from.- Returns:
- The extracted body.
- Throws:
IOException
- if an error occurred while reading the response.org.apache.http.ParseException
- if the entity of the response could not be parsed.
-