You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Alex Quezada <al...@deepwebtech.com> on 2006/12/18 21:55:11 UTC

Problem with POST using proxy

I have come across a problem doing a POST when going through a proxy.  
The same operation works fine without the proxy.  I'm trying to figure 
out if it's an httpclient bug, or perhaps some HTTP protocol violation 
on the site I'm going to.  From the debug statements, it seems to me 
that httpclient is sending all the headers first, then getting a 
response including the proxy response.  Then it sends the actual POST 
parameters, but appears to not send the headers again.  This request 
times out, but using the browser works fine.

This was with version 3.0.  I tried 3.0.1 and also 3.1-beta but same 
results.

Alex Quezada

Debug output:

2006-12-18 13:57:03,832 DEBUG [org.apache.commons.httpclient.HttpClient] - <Java version: 1.5.0_07>
2006-12-18 13:57:03,833 DEBUG [org.apache.commons.httpclient.HttpClient] - <Java vendor: Sun Microsystems Inc.>
2006-12-18 13:57:03,833 DEBUG [org.apache.commons.httpclient.HttpClient] - <Java class path: :/srv/tomcat/bin/bootstrap.jar:/srv/tomcat/bin/commons-logging-api.jar>
2006-12-18 13:57:03,833 DEBUG [org.apache.commons.httpclient.HttpClient] - <Operating system name: Linux>
2006-12-18 13:57:03,833 DEBUG [org.apache.commons.httpclient.HttpClient] - <Operating system architecture: i386>
2006-12-18 13:57:03,833 DEBUG [org.apache.commons.httpclient.HttpClient] - <Operating system version: 2.6.13-15.12-smp>
2006-12-18 13:57:03,856 DEBUG [org.apache.commons.httpclient.HttpClient] - <SUN 1.5: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores)>
2006-12-18 13:57:03,856 DEBUG [org.apache.commons.httpclient.HttpClient] - <SunRsaSign 1.5: Sun RSA signature provider>
2006-12-18 13:57:03,856 DEBUG [org.apache.commons.httpclient.HttpClient] - <SunJSSE 1.5: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)>
2006-12-18 13:57:03,856 DEBUG [org.apache.commons.httpclient.HttpClient] - <SunJCE 1.5: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)>
2006-12-18 13:57:03,856 DEBUG [org.apache.commons.httpclient.HttpClient] - <SunJGSS 1.0: Sun (Kerberos v5)>
2006-12-18 13:57:03,856 DEBUG [org.apache.commons.httpclient.HttpClient] - <SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5)>
2006-12-18 13:57:03,871 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.useragent = Jakarta Commons-HttpClient/3.0>
2006-12-18 13:57:03,873 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.version = HTTP/1.1>
2006-12-18 13:57:03,875 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager>
2006-12-18 13:57:03,875 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.cookie-policy = rfc2109>
2006-12-18 13:57:03,875 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.element-charset = US-ASCII>
2006-12-18 13:57:03,875 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.content-charset = ISO-8859-1>
2006-12-18 13:57:03,877 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@14f5a31>
2006-12-18 13:57:03,878 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.unambiguous-statusline = false>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.single-cookie-header = false>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.strict-transfer-encoding = false>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.reject-head-body = false>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.warn-extra-input = false>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.status-line-garbage-limit = 2147483647>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.reject-relative-redirect = false>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.allow-circular-redirects = false>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.max-redirects = 5>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.allow-circular-redirects = false>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@1c0cb76>
2006-12-18 13:57:03,890 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.connection.timeout = 30000>
2006-12-18 13:57:03,892 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.connection-manager.max-per-host = {HostConfiguration[]=32}>
2006-12-18 13:57:03,892 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.connection-manager.max-total = 128>
2006-12-18 13:57:04,147 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.expect-continue = true>
2006-12-18 13:57:04,148 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.setRequestBody(NameValuePair[])>
2006-12-18 13:57:04,148 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.clearRequestBody()>
2006-12-18 13:57:04,148 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.clearRequestBody()>
2006-12-18 13:57:04,148 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.addParameters(NameValuePair[])>
2006-12-18 13:57:04,148 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.clearRequestBody()>
2006-12-18 13:57:04,148 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <HttpMethodBase.addRequestHeader(Header)>
2006-12-18 13:57:04,148 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.protocol.cookie-policy = compatibility>
2006-12-18 13:57:04,148 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - <Set parameter http.socket.timeout = 30000>
2006-12-18 13:57:04,148 DEBUG [org.apache.commons.httpclient.HttpClient] - <enter HttpClient.executeMethod(HttpMethod)>
2006-12-18 13:57:04,149 DEBUG [org.apache.commons.httpclient.HttpClient] - <enter HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)>
2006-12-18 13:57:04,166 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - <enter HttpConnectionManager.getConnectionWithTimeout(HostConfiguration, long)>
2006-12-18 13:57:04,167 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - <HttpConnectionManager.getConnection:  config = HostConfiguration[host=http://www.knovel.com, proxyHost=http://fileserver.deepwebtech.lan:3128], timeout = 0>
2006-12-18 13:57:04,167 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - <enter HttpConnectionManager.ConnectionPool.getHostPool(HostConfiguration)>
2006-12-18 13:57:04,168 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - <enter HttpConnectionManager.ConnectionPool.getHostPool(HostConfiguration)>
2006-12-18 13:57:04,168 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - <Allocating new connection, hostConfig=HostConfiguration[host=http://www.knovel.com, proxyHost=http://fileserver.deepwebtech.lan:3128]>
2006-12-18 13:57:04,174 DEBUG [org.apache.commons.httpclient.HttpMethodDirector] - <Attempt number 1 to process request>
2006-12-18 13:57:04,174 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.open()>
2006-12-18 13:57:04,174 DEBUG [org.apache.commons.httpclient.HttpConnection] - <Open connection to fileserver.deepwebtech.lan:3128>
2006-12-18 13:57:04,177 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.execute(HttpState, HttpConnection)>
2006-12-18 13:57:04,178 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.writeRequest(HttpState, HttpConnection)>
2006-12-18 13:57:04,178 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)>
2006-12-18 13:57:04,178 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.generateRequestLine(HttpConnection, String, String, String, String)>
2006-12-18 13:57:04,179 DEBUG [httpclient.wire.header] - <>> "POST http://www.knovel.com/knovel2/SearchResults.jsp HTTP/1.1[\r][\n]">
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.addRequestHeaders(HttpState, HttpConnection)>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.methods.ExpectContinueMethod] - <enter ExpectContinueMethod.addRequestHeaders(HttpState, HttpConnection)>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection)>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <Adding Host request header>
2006-12-18 13:57:04,180 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)>
2006-12-18 13:57:04,211 DEBUG [org.apache.commons.httpclient.HttpState] - <enter HttpState.getCookies()>
2006-12-18 13:57:04,211 DEBUG [org.apache.commons.httpclient.cookie.CookieSpec] - <enter CookieSpecBase.match(String, int, String, boolean, Cookie[])>
2006-12-18 13:57:04,211 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addProxyConnectionHeader(HttpState, HttpConnection)>
2006-12-18 13:57:04,211 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <HttpMethodBase.addRequestHeader(Header)>
2006-12-18 13:57:04,211 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.hasRequestContent()>
2006-12-18 13:57:04,212 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.addContentLengthRequestHeader(HttpState, HttpConnection)>
2006-12-18 13:57:04,212 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.getRequestContentLength()>
2006-12-18 13:57:04,212 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.hasRequestContent()>
2006-12-18 13:57:04,212 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.getParameters()>
2006-12-18 13:57:04,212 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter getContentCharSet( Header contentheader )>
2006-12-18 13:57:04,212 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <Default charset used: ISO-8859-1>
2006-12-18 13:57:04,213 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <HttpMethodBase.addRequestHeader(Header)>
2006-12-18 13:57:04,214 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.getParameters()>
2006-12-18 13:57:04,214 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter getContentCharSet( Header contentheader )>
2006-12-18 13:57:04,214 DEBUG [org.apache.commons.httpclient.HeaderElement] - <enter HeaderElement.parseElements(String)>
2006-12-18 13:57:04,214 DEBUG [org.apache.commons.httpclient.HeaderElement] - <enter HeaderElement.parseElements(char[])>
2006-12-18 13:57:04,216 DEBUG [org.apache.commons.httpclient.HeaderElement] - <enter HeaderElement.getParameterByName(String)>
2006-12-18 13:57:04,216 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <Default charset used: ISO-8859-1>
2006-12-18 13:57:04,217 DEBUG [httpclient.wire.header] - <>> "user-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0[\r][\n]">
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:57:04,217 DEBUG [httpclient.wire.header] - <>> "Host: www.knovel.com[\r][\n]">
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:57:04,217 DEBUG [httpclient.wire.header] - <>> "Proxy-Connection: Keep-Alive[\r][\n]">
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:57:04,217 DEBUG [httpclient.wire.header] - <>> "Expect: 100-continue[\r][\n]">
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:57:04,217 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:57:04,218 DEBUG [httpclient.wire.header] - <>> "Content-Length: 140[\r][\n]">
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:57:04,218 DEBUG [httpclient.wire.header] - <>> "Content-Type: application/x-www-form-urlencoded[\r][\n]">
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.writeLine()>
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:57:04,218 DEBUG [httpclient.wire.header] - <>> "[\r][\n]">
2006-12-18 13:57:04,218 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.flushRequestOutputStream()>
2006-12-18 13:57:04,219 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.readStatusLine(HttpState, HttpConnection)>
2006-12-18 13:57:04,219 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.readLine()>
2006-12-18 13:57:04,220 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:57:04,220 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:57:04,448 DEBUG [httpclient.wire.header] - <<< "HTTP/1.0 100 Continue[\r][\n]">
2006-12-18 13:57:04,449 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.readResponseHeaders(HttpState,HttpConnection)>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.getResponseInputStream()>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HeaderParser.parseHeaders(InputStream, String)>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:57:04,450 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:57:04,451 DEBUG [httpclient.wire.header] - <<< "Server: Resin/3.0.21[\r][\n]">
2006-12-18 13:57:04,451 DEBUG [httpclient.wire.header] - <<< "Content-Length: 0[\r][\n]">
2006-12-18 13:57:04,451 DEBUG [httpclient.wire.header] - <<< "Date: Mon, 18 Dec 2006 20:48:38 GMT[\r][\n]">
2006-12-18 13:57:04,451 DEBUG [httpclient.wire.header] - <<< "X-Cache: MISS from dwt02.deepwebtech.lan[\r][\n]">
2006-12-18 13:57:04,451 DEBUG [httpclient.wire.header] - <<< "X-Cache-Lookup: MISS from dwt02.deepwebtech.lan:3128[\r][\n]">
2006-12-18 13:57:04,451 DEBUG [httpclient.wire.header] - <<< "Proxy-Connection: keep-alive[\r][\n]">
2006-12-18 13:57:04,451 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.processResponseHeaders(HttpState, HttpConnection)>
2006-12-18 13:57:04,451 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <OK to continue received>
2006-12-18 13:57:04,451 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.writeRequestBody(HttpState, HttpConnection)>
2006-12-18 13:57:04,451 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.hasRequestContent()>
2006-12-18 13:57:04,451 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.getRequestContentLength()>
2006-12-18 13:57:04,451 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.hasRequestContent()>
2006-12-18 13:57:04,451 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.getRequestOutputStream()>
2006-12-18 13:57:04,452 DEBUG [httpclient.wire.content] - <>> "QueryBox=&SecondSelect1=&SubSubjectAreaID=&SubjectAreaID=-2&SearchTermA1=nanotechnology&FirstSelect1=0&BookID=0&VerticalID=0&DoFullText=true">
2006-12-18 13:57:04,452 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <Request body sent>
2006-12-18 13:57:04,452 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.flushRequestOutputStream()>
2006-12-18 13:57:04,452 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.readResponse(HttpState, HttpConnection)>
2006-12-18 13:57:04,452 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.readStatusLine(HttpState, HttpConnection)>
2006-12-18 13:57:04,452 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.readLine()>
2006-12-18 13:57:04,452 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:57:04,452 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:58:04,531 DEBUG [org.apache.commons.httpclient.HttpMethodDirector] - <Closing the connection.>
2006-12-18 13:58:04,532 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.close()>
2006-12-18 13:58:04,532 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.closeSockedAndStreams()>
2006-12-18 13:58:04,532 INFO [org.apache.commons.httpclient.HttpMethodDirector] - <I/O exception (org.apache.commons.httpclient.NoHttpResponseException) caught when processing request: The server www.knovel.com failed to respond>
2006-12-18 13:58:04,534 DEBUG [org.apache.commons.httpclient.HttpMethodDirector] - <The server www.knovel.com failed to respond>
org.apache.commons.httpclient.NoHttpResponseException: The server www.knovel.com failed to respond
	at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1835)
	at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
	at com.deepwebtech.assistant.dwse.util.SearchClient.executeMethod(SearchClient.java:1292)
	at com.deepwebtech.assistant.dwse.util.SearchClient.executePhase(SearchClient.java:817)
	at com.deepwebtech.assistant.dwse.util.SearchClient.parseConfig(SearchClient.java:418)
	at com.deepwebtech.assistant.dwse.util.SearchClient.run(SearchClient.java:274)
2006-12-18 13:58:04,535 INFO [org.apache.commons.httpclient.HttpMethodDirector] - <Retrying request>
2006-12-18 13:58:04,536 DEBUG [org.apache.commons.httpclient.HttpMethodDirector] - <Attempt number 2 to process request>
2006-12-18 13:58:04,536 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.open()>
2006-12-18 13:58:04,536 DEBUG [org.apache.commons.httpclient.HttpConnection] - <Open connection to fileserver.deepwebtech.lan:3128>
2006-12-18 13:58:04,538 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.execute(HttpState, HttpConnection)>
2006-12-18 13:58:04,538 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.writeRequest(HttpState, HttpConnection)>
2006-12-18 13:58:04,538 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)>
2006-12-18 13:58:04,538 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.generateRequestLine(HttpConnection, String, String, String, String)>
2006-12-18 13:58:04,538 DEBUG [httpclient.wire.header] - <>> "POST http://www.knovel.com/knovel2/SearchResults.jsp HTTP/1.0[\r][\n]">
2006-12-18 13:58:04,538 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.addRequestHeaders(HttpState, HttpConnection)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.methods.ExpectContinueMethod] - <enter ExpectContinueMethod.addRequestHeaders(HttpState, HttpConnection)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <Adding Host request header>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpState] - <enter HttpState.getCookies()>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.cookie.CookieSpec] - <enter CookieSpecBase.match(String, int, String, boolean, Cookie[])>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.addProxyConnectionHeader(HttpState, HttpConnection)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.addContentLengthRequestHeader(HttpState, HttpConnection)>
2006-12-18 13:58:04,539 DEBUG [httpclient.wire.header] - <>> "user-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0[\r][\n]">
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:58:04,539 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:58:04,540 DEBUG [httpclient.wire.header] - <>> "Proxy-Connection: Keep-Alive[\r][\n]">
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:58:04,540 DEBUG [httpclient.wire.header] - <>> "Content-Length: 140[\r][\n]">
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:58:04,540 DEBUG [httpclient.wire.header] - <>> "Content-Type: application/x-www-form-urlencoded[\r][\n]">
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:58:04,540 DEBUG [httpclient.wire.header] - <>> "Host: www.knovel.com[\r][\n]">
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.print(String)>
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:58:04,540 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.writeLine()>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[])>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.write(byte[], int, int)>
2006-12-18 13:58:04,541 DEBUG [httpclient.wire.header] - <>> "[\r][\n]">
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.writeRequestBody(HttpState, HttpConnection)>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.hasRequestContent()>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <enter EntityEnclosingMethod.getRequestContentLength()>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.methods.PostMethod] - <enter PostMethod.hasRequestContent()>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.getRequestOutputStream()>
2006-12-18 13:58:04,541 DEBUG [httpclient.wire.content] - <>> "QueryBox=&SecondSelect1=&SubSubjectAreaID=&SubjectAreaID=-2&SearchTermA1=nanotechnology&FirstSelect1=0&BookID=0&VerticalID=0&DoFullText=true">
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - <Request body sent>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.flushRequestOutputStream()>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.readResponse(HttpState, HttpConnection)>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - <enter HttpMethodBase.readStatusLine(HttpState, HttpConnection)>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.readLine()>
2006-12-18 13:58:04,541 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readLine(InputStream, String)>
2006-12-18 13:58:04,542 DEBUG [org.apache.commons.httpclient.HttpParser] - <enter HttpParser.readRawLine()>
2006-12-18 13:58:05,821 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.close()>
2006-12-18 13:58:05,821 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.closeSockedAndStreams()>
2006-12-18 13:58:05,821 DEBUG [org.apache.commons.httpclient.HttpMethodDirector] - <Closing the connection.>
2006-12-18 13:58:05,822 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.close()>
2006-12-18 13:58:05,822 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.closeSockedAndStreams()>
2006-12-18 13:58:05,822 DEBUG [org.apache.commons.httpclient.HttpMethodDirector] - <Method retry handler returned false. Automatic recovery will not be attempted>
2006-12-18 13:58:05,822 DEBUG [org.apache.commons.httpclient.HttpConnection] - <enter HttpConnection.releaseConnection()>
2006-12-18 13:58:05,822 DEBUG [org.apache.commons.httpclient.HttpConnection] - <Releasing connection back to connection manager.>
2006-12-18 13:58:05,822 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - <enter HttpConnectionManager.releaseConnection(HttpConnection)>
2006-12-18 13:58:05,822 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - <Freeing connection, hostConfig=HostConfiguration[host=http://www.knovel.com, proxyHost=http://fileserver.deepwebtech.lan:3128]>
2006-12-18 13:58:05,822 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - <enter HttpConnectionManager.ConnectionPool.getHostPool(HostConfiguration)>
2006-12-18 13:58:05,824 DEBUG [org.apache.commons.httpclient.util.IdleConnectionHandler] - <Adding connection at: 1166475485823>
2006-12-18 13:58:05,824 DEBUG [org.apache.commons.httpclient.MultiThreadedHttpConnectionManager] - <Notifying no-one, there are no waiting threads>



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: Problem with POST using proxy

Posted by Roland Weber <ht...@dubioso.net>.
Hello Alex,

> From the debug statements, it seems to me
> that httpclient is sending all the headers first, then getting a
> response including the proxy response.  Then it sends the actual POST
> parameters, but appears to not send the headers again.  This request
> times out, but using the browser works fine.

this is called the expect-continue handshake. The request line and
headers are sent, and one of the headers is "Expect: 100-continue".
The client then waits for an _intermediate_ response with status
code 100 before sending the request body. There is nothing wrong here,
except that the server isn't responding.

I doubt that your browser just sends that request. I would expect
that the browsers starts by sending a request for the page that
holds the web form, submitting it only afterwards once you've
entered something. If you're only sending the POST using HttpClient,
the server may behave differently because the request is not part
of an established session.

Our Client HTTP Programming Primer describes in great detail
how to simulate browser behaviour when submitting an HTML form.
It also suggests things to try if you run into problems:
http://wiki.apache.org/jakarta-httpclient/ForAbsoluteBeginners

hope that helps,
  Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org