private List<BatchResponseItem> parseBatchResponse(final Response response) throws IOException { return BatchPayloadParser.parse( (InputStream) response.getEntity(), response.getMediaType(), new BatchResponseItem()); }
/** * Parses the latest Response received into a list of {@link BatchResponseItem}s. * * @return the Batch Response parsed as list of {@link BatchResponseItem}s * @throws IOException if there are issues when reading the response body */ public List<BatchResponseItem> getItems() throws IOException { String body = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8.name()); LOG.debug("Batch response body:\n{}", body); return BatchPayloadParser.parse( new ByteArrayInputStream(body.getBytes()), response.getMediaType(), new BatchResponseItem()); } }
/** * Parses the latest Response received into a list of {@link BatchResponseItem}s. * * @return the Batch Response parsed as list of {@link BatchResponseItem}s * @throws IOException if there are issues when reading the response body */ public List<BatchResponseItem> getItems() throws IOException { String body = IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8.name()); LOG.debug("Batch response body:\n{}", body); return BatchPayloadParser.parse( new ByteArrayInputStream(body.getBytes()), response.getMediaType(), new BatchResponseItem()); } }
batchRequestItems = BatchPayloadParser.parse(input, mediaType, new BatchRequestItem()); } catch (IOException e) { LOG.error("Could not parse batch request with boundary {}", boundary, e);