@Converter public static InputStream toInputStream(HttpMessage message, Exchange exchange) throws Exception { return toInputStream(toServletRequest(message), exchange); }
@Converter public static BufferedReader toReader(HttpMessage message) throws IOException { HttpServletRequest request = toServletRequest(message); if (request != null) { return request.getReader(); } return null; }
/** * Reads the response body from the given http servlet request. * * @param request http servlet request * @param exchange the exchange * @return the request body, can be <tt>null</tt> if no body * @throws IOException is thrown if error reading response body */ public static Object readRequestBodyFromServletRequest(HttpServletRequest request, Exchange exchange) throws IOException { InputStream is = HttpConverter.toInputStream(request, exchange); return readResponseBodyFromInputStream(is, exchange); }
@Converter public static ServletInputStream toServletInputStream(HttpMessage message) throws IOException { HttpServletRequest request = toServletRequest(message); if (request != null) { return request.getInputStream(); } return null; }