Class HttpEntityUtil

java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.HttpEntityUtil

public class HttpEntityUtil extends Object
Util class extracting the entity of an HttpResponse, unzipping it if necessary, and finally consuming the response.
  • 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 the HttpEntity.
      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.