Class ResponseUtils


  • public final class ResponseUtils
    extends Object
    • Method Detail

      • mapOkResponseOrThrowException

        public static <T> T mapOkResponseOrThrowException​(org.apache.http.HttpResponse response,
                                                          Function<org.apache.http.HttpResponse,​T> okResponseMapper)
      • unmarshallEntity

        public static <T> T unmarshallEntity​(org.apache.http.HttpResponse response,
                                             Class<T> returnType)
      • unmarshallEntities

        public static <T> Stream<T> unmarshallEntities​(org.apache.http.HttpResponse response,
                                                       Class<T> returnType)
      • readErrorEntity

        public static Error readErrorEntity​(org.apache.http.HttpResponse response)
      • getResponseEntityContent

        public static InputStream getResponseEntityContent​(org.apache.http.HttpResponse response)
      • parseDelayDurationOfRetryAfterHeader

        public static Optional<Duration> parseDelayDurationOfRetryAfterHeader​(org.apache.http.HttpResponse response)
      • parseDelayDurationOfRetryAfterHeader

        public static Optional<Duration> parseDelayDurationOfRetryAfterHeader​(org.apache.http.HttpResponse response,
                                                                              Clock clock)
      • getValueOfFirstHeader

        public static Optional<String> getValueOfFirstHeader​(org.apache.http.HttpResponse response,
                                                             String headerName)
      • isOkResponse

        public static boolean isOkResponse​(org.apache.http.HttpResponse response)
      • isOkResponse

        public static boolean isOkResponse​(org.apache.http.StatusLine status)
      • isOkResponse

        public static boolean isOkResponse​(int statusCode)