/** * Returns the charset to be used for {@link org.apache.commons.httpclient.Credentials}. If * not configured the {@link #HTTP_ELEMENT_CHARSET HTTP element charset} is used. * @return The charset */ public String getCredentialCharset() { String charset = (String) getParameter(CREDENTIAL_CHARSET); if (charset == null) { LOG.debug("Credential charset not configured, using HTTP element charset"); charset = getHttpElementCharset(); } return charset; }
/** * Reads and stores the Trailer headers. * @throws IOException If an IO problem occurs */ private void parseTrailerHeaders() throws IOException { Header[] footers = null; try { String charset = "US-ASCII"; if (this.method != null) { charset = this.method.getParams().getHttpElementCharset(); } footers = HttpParser.parseHeaders(in, charset); } catch(HttpException e) { LOG.error("Error parsing trailer headers", e); IOException ioe = new IOException(e.getMessage()); ExceptionUtil.initCause(ioe, e); throw ioe; } if (this.method != null) { for (int i = 0; i < footers.length; i++) { this.method.addResponseFooter(footers[i]); } } }
buffer.append(getEffectiveVersion()); String line = buffer.toString(); conn.printLine(line, getParams().getHttpElementCharset()); if (Wire.HEADER_WIRE.enabled()) { Wire.HEADER_WIRE.output(line);
/** * Writes the request line to the given {@link HttpConnection connection}. * * <p> * Subclasses may want to override this method to to customize the * processing. * </p> * * @param state the {@link HttpState state} information associated with this method * @param conn the {@link HttpConnection connection} used to execute * this HTTP method * * @throws IOException if an I/O (transport) error occurs. Some transport exceptions * can be recovered from. * @throws HttpException if a protocol exception occurs. Usually protocol exceptions * cannot be recovered from. * * @see #generateRequestLine */ protected void writeRequestLine(HttpState state, HttpConnection conn) throws IOException, HttpException { LOG.trace( "enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)"); String requestLine = getRequestLine(conn); if (Wire.HEADER_WIRE.enabled()) { Wire.HEADER_WIRE.output(requestLine); } conn.print(requestLine, getParams().getHttpElementCharset()); }
conn.getResponseInputStream(), getParams().getHttpElementCharset());
addRequestHeaders(state, conn); String charset = getParams().getHttpElementCharset();
String s; do { s = conn.readLine(getParams().getHttpElementCharset()); if (s == null && count == 0) {
/** * Returns the charset to be used for {@link org.apache.commons.httpclient.Credentials}. If * not configured the {@link #HTTP_ELEMENT_CHARSET HTTP element charset} is used. * @return The charset */ public String getCredentialCharset() { String charset = (String) getParameter(CREDENTIAL_CHARSET); if (charset == null) { LOG.debug("Credential charset not configured, using HTTP element charset"); charset = getHttpElementCharset(); } return charset; }
/** * Returns the charset to be used for {@link org.apache.commons.httpclient.Credentials}. If * not configured the {@link #HTTP_ELEMENT_CHARSET HTTP element charset} is used. * @return The charset */ public String getCredentialCharset() { String charset = (String) getParameter(CREDENTIAL_CHARSET); if (charset == null) { LOG.debug("Credential charset not configured, using HTTP element charset"); charset = getHttpElementCharset(); } return charset; }
/** * Returns the charset to be used for {@link org.apache.commons.httpclient.Credentials}. If * not configured the {@link #HTTP_ELEMENT_CHARSET HTTP element charset} is used. * @return The charset */ public String getCredentialCharset() { String charset = (String) getParameter(CREDENTIAL_CHARSET); if (charset == null) { LOG.debug("Credential charset not configured, using HTTP element charset"); charset = getHttpElementCharset(); } return charset; }
/** * Returns the charset to be used for {@link org.apache.commons.httpclient.Credentials}. If * not configured the {@link #HTTP_ELEMENT_CHARSET HTTP element charset} is used. * @return The charset */ public String getCredentialCharset() { String charset = (String) getParameter(CREDENTIAL_CHARSET); if (charset == null) { LOG.debug("Credential charset not configured, using HTTP element charset"); charset = getHttpElementCharset(); } return charset; }
/** * Reads and stores the Trailer headers. * @throws IOException If an IO problem occurs */ private void parseTrailerHeaders() throws IOException { Header[] footers = null; try { String charset = "US-ASCII"; if (this.method != null) { charset = this.method.getParams().getHttpElementCharset(); } footers = HttpParser.parseHeaders(in, charset); } catch(HttpException e) { LOG.error("Error parsing trailer headers", e); IOException ioe = new IOException(e.getMessage()); ExceptionUtil.initCause(ioe, e); throw ioe; } if (this.method != null) { for (int i = 0; i < footers.length; i++) { this.method.addResponseFooter(footers[i]); } } }
/** * {@inheritDoc} * * <strong>Note:</strong> Malformed HTTP header lines are ignored (instead of throwing an exception). */ /* * Implementation copied from HttpMethodBase#readResponseHeaders(HttpState, HttpConnection) but changed to use a custom * header parser (ZapHttpParser#parseHeaders(InputStream, String)). */ @Override protected void readResponseHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException { getResponseHeaderGroup().clear(); Header[] headers = ZapHttpParser.parseHeaders(conn.getResponseInputStream(), getParams().getHttpElementCharset()); // Wire logging moved to HttpParser getResponseHeaderGroup().setHeaders(headers); }
/** * {@inheritDoc} * * <strong>Note:</strong> Malformed HTTP header lines are ignored (instead of throwing an exception). */ /* * Implementation copied from HttpMethodBase#readResponseHeaders(HttpState, HttpConnection) but changed to use a custom * header parser (ZapHttpParser#parseHeaders(InputStream, String)). */ @Override protected void readResponseHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException { getResponseHeaderGroup().clear(); Header[] headers = ZapHttpParser.parseHeaders(conn.getResponseInputStream(), getParams().getHttpElementCharset()); // Wire logging moved to HttpParser getResponseHeaderGroup().setHeaders(headers); } }
/** * {@inheritDoc} * * <strong>Note:</strong> Malformed HTTP header lines are ignored (instead of throwing an exception). */ /* * Implementation copied from HttpMethodBase#readResponseHeaders(HttpState, HttpConnection) but changed to use a custom * header parser (ZapHttpParser#parseHeaders(InputStream, String)). */ @Override protected void readResponseHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException { getResponseHeaderGroup().clear(); Header[] headers = ZapHttpParser.parseHeaders(conn.getResponseInputStream(), getParams().getHttpElementCharset()); // Wire logging moved to HttpParser getResponseHeaderGroup().setHeaders(headers); } }
/** * {@inheritDoc} * * <strong>Note:</strong> Malformed HTTP header lines are ignored (instead of throwing an exception). */ /* * Implementation copied from HttpMethodBase#readResponseHeaders(HttpState, HttpConnection) but changed to use a custom * header parser (ZapHttpParser#parseHeaders(InputStream, String)). */ @Override protected void readResponseHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException { getResponseHeaderGroup().clear(); Header[] headers = ZapHttpParser.parseHeaders(conn.getResponseInputStream(), getParams().getHttpElementCharset()); // Wire logging moved to HttpParser getResponseHeaderGroup().setHeaders(headers); } }
/** * {@inheritDoc} * * <strong>Note:</strong> Malformed HTTP header lines are ignored (instead of throwing an exception). */ /* * Implementation copied from HttpMethodBase#readResponseHeaders(HttpState, HttpConnection) but changed to use a custom * header parser (ZapHttpParser#parseHeaders(InputStream, String)). */ @Override protected void readResponseHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException { getResponseHeaderGroup().clear(); Header[] headers = ZapHttpParser.parseHeaders(conn.getResponseInputStream(), getParams().getHttpElementCharset()); // Wire logging moved to HttpParser getResponseHeaderGroup().setHeaders(headers); } }
/** * {@inheritDoc} * * <strong>Note:</strong> Malformed HTTP header lines are ignored (instead of throwing an exception). */ /* * Implementation copied from HttpMethodBase#readResponseHeaders(HttpState, HttpConnection) but changed to use a custom * header parser (ZapHttpParser#parseHeaders(InputStream, String)). */ @Override protected void readResponseHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException { getResponseHeaderGroup().clear(); Header[] headers = ZapHttpParser.parseHeaders(conn.getResponseInputStream(), getParams().getHttpElementCharset()); // Wire logging moved to HttpParser getResponseHeaderGroup().setHeaders(headers); } }
/** * {@inheritDoc} * * <strong>Note:</strong> Malformed HTTP header lines are ignored (instead of throwing an exception). */ /* * Implementation copied from HttpMethodBase#readResponseHeaders(HttpState, HttpConnection) but changed to use a custom * header parser (ZapHttpParser#parseHeaders(InputStream, String)). */ @Override protected void readResponseHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException { getResponseHeaderGroup().clear(); Header[] headers = ZapHttpParser.parseHeaders(conn.getResponseInputStream(), getParams().getHttpElementCharset()); // Wire logging moved to HttpParser getResponseHeaderGroup().setHeaders(headers); } }
/** * {@inheritDoc} * * <strong>Note:</strong> Malformed HTTP header lines are ignored (instead of throwing an exception). */ /* * Implementation copied from HttpMethodBase#readResponseHeaders(HttpState, HttpConnection) but changed to use a custom * header parser (ZapHttpParser#parseHeaders(InputStream, String)). */ @Override protected void readResponseHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException { getResponseHeaderGroup().clear(); Header[] headers = ZapHttpParser.parseHeaders(conn.getResponseInputStream(), getParams().getHttpElementCharset()); // Wire logging moved to HttpParser getResponseHeaderGroup().setHeaders(headers); } }