M
markusw2006
Hello,
I have a problem with the commons-httpclient package (jakarta). Suppose
I want to send a POST request (PostMethod in commons-httpclient) to the
URL http://my-server:9999/Test. The commons-httpclient generates a
request looking like this:
POST /Test HTTP/1.1
User Agent: Jakarta Commons-HttpClient/3.0-rc2
HOST: my-server:9999
....
This is a valid request. But in our intranet the request is blocked by
a firewall, because of the relative path in the request line (first
line). The firewall needs a request like this:
POST http://my-server:9999/Test HTTP/1.1
User Agent: Jakarta Commons-HttpClient/3.0-rc2
HOST: my-server:9999
....
This format is mandatory (RFC 2616) if the request is send via a proxy.
I've examined the commons-httpclient code and found out that the
complete URL is written in the request line if I set a proxy in the
HttpClient class (in the HostConfiguration). But I don't know the URL
of the proxy where the firewall runs. Is there another way to force the
commons-httpclient to write the full URL?
I've tried to set the destination server as proxy, too (in the example
above I've set my-server:9999 as proxy). This worked in a local
environment. I haven't tested if this will work in our intranet (since
the test will take some time) and it also looks a little bit like a
dirty workaround to me.
Regards
Markus
I have a problem with the commons-httpclient package (jakarta). Suppose
I want to send a POST request (PostMethod in commons-httpclient) to the
URL http://my-server:9999/Test. The commons-httpclient generates a
request looking like this:
POST /Test HTTP/1.1
User Agent: Jakarta Commons-HttpClient/3.0-rc2
HOST: my-server:9999
....
This is a valid request. But in our intranet the request is blocked by
a firewall, because of the relative path in the request line (first
line). The firewall needs a request like this:
POST http://my-server:9999/Test HTTP/1.1
User Agent: Jakarta Commons-HttpClient/3.0-rc2
HOST: my-server:9999
....
This format is mandatory (RFC 2616) if the request is send via a proxy.
I've examined the commons-httpclient code and found out that the
complete URL is written in the request line if I set a proxy in the
HttpClient class (in the HostConfiguration). But I don't know the URL
of the proxy where the firewall runs. Is there another way to force the
commons-httpclient to write the full URL?
I've tried to set the destination server as proxy, too (in the example
above I've set my-server:9999 as proxy). This worked in a local
environment. I haven't tested if this will work in our intranet (since
the test will take some time) and it also looks a little bit like a
dirty workaround to me.
Regards
Markus