/** * Convert the HTTP message's body into a String. * <p> * The body is returned without being decoded (i.e. raw). * To get the decoded body, use * {@link #decodeBody()} or {@link #decodeBodyToString(Charset)}. * * @param charset text message's charset * @return String representing the raw HTTP message's body. * @throws IOException if an error occurs while consuming the message body */ public String asRawString(Charset charset) throws IOException { return new String(asRawBytes(), charset); }
/** * Convert the HTTP message's body into a String. * <p> * The body is returned without being decoded (i.e. raw). * To get the decoded body, use * {@link #decodeBody()} or {@link #decodeBodyToString(Charset)}. * * @param charset text message's charset * @return String representing the raw HTTP message's body. * @throws IOException if an error occurs while consuming the message body */ public String asRawString(Charset charset) throws IOException { return new String(asRawBytes(), charset); }
@Override public byte[] asRawBytes() throws IOException { markConsumed(); return super.asRawBytes(); }
@Override public byte[] asRawBytes() throws IOException { markConsumed(); return super.asRawBytes(); }