/** * Parses a HTTP response's status-line. * <p> * This method does not perform validation of characters and is provided for * performance reasons where the status-line is known to be legal. * Prefer to use {@link HttpMetadataParser#parseStatusLine(InputStream)} in case the input cannot be trusted. * * @param statusLine the status-line * @return the status-line * @throws InvalidHttpResponse if the status-line is invalid */ public StatusLine parseStatusLine(String statusLine) { return buildStatusLine(statusLine); }
/** * Parses a HTTP response's status-line. * <p> * This method does not perform validation of characters and is provided for * performance reasons where the status-line is known to be legal. * Prefer to use {@link HttpMetadataParser#parseStatusLine(InputStream)} in case the input cannot be trusted. * * @param statusLine the status-line * @return the status-line * @throws InvalidHttpResponse if the status-line is invalid */ public StatusLine parseStatusLine(String statusLine) { return buildStatusLine(statusLine); }
/** * Parses a HTTP response's status-line. * * @param inputStream providing the status-line * @return the status-line * @throws InvalidHttpResponse if the status-line is invalid * @throws IOException if an error occurs while consuming the stream */ public StatusLine parseStatusLine(InputStream inputStream) throws IOException { return buildStatusLine(parseStartLine(inputStream, InvalidHttpResponse::new, options.ignoreLeadingEmptyLine())); }
/** * Parses a HTTP response's status-line. * * @param inputStream providing the status-line * @return the status-line * @throws InvalidHttpResponse if the status-line is invalid * @throws IOException if an error occurs while consuming the stream */ public StatusLine parseStatusLine(InputStream inputStream) throws IOException { return buildStatusLine(parseStartLine(inputStream, InvalidHttpResponse::new, options.ignoreLeadingEmptyLine())); }