There is a HttpProxyGenerator in Cocoon 2.1 blocks doing such thing.
However, it does not do exactly what you explained. It is possible to
set method (Get, POST) but I think no header processing is done.
I posted a message on it sometime ago explaining some problems I faced
with HttpProxyGenerator that I think mostly applies to your code too.
Therefore I post again here so that in case you are interested to
improve your code (or HttpProxyGenerator) consider them:
1- If the returned page is in Shift_JIS encoding (Japanese character set),
then processing is stoped and says some characters are not supported in
UTF-8.
I changed the source code and inserted something like following before
parsing of the result starts:
inputSource.setEncoding("Shift_JIS");
This worked for me. However, it would be nice to have a configuration
parameter to allow this setting in sitemap.
2- If the result is in HTML but not XML format it can't proceed. I think
it is good idea to combine functionlaity of HttpGenerator (I mean
tidying the input) inside this generator too.
[However, I had same problems of encoding with HttpGenerator. So it
would be nice to resolve that problem too.]
3- When the result page has redirection I get an error on consule as
follow:
INFO: Redirect requested but followRedirects is disabled
I see in the source code something like this:
this.method.setFollowRedirects(true);
However I don't know why it does not work.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]