Re: Html download challenge
- From: Raymond DeCampo <nospam@xxxxxxxxxxxx>
- Date: Fri, 01 Jul 2005 00:30:50 GMT
Andrea Desole wrote:
sks wrote:
Maybe the URLConn adds some headers by default, such as user-agent: Java or
something which google is rejecting.
that's what I thought, but I dumped all the request parameters, and the list turned out to be empty. If the class does it, it hides it.
I would really like to know how they do it.
Using the TcpTunnelGui from apache SOAP, I see that this is what is sent by Java when running the above program:
============= start ========================================= GET / HTTP/1.1 User-Agent: Java/1.5.0_03 Host: localhost:8888 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Connection: keep-alive Content-type: application/x-www-form-urlencoded
GET /search?q=business HTTP/1.1 User-Agent: Java/1.5.0_03 Host: localhost:8888 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Connection: keep-alive Content-type: application/x-www-form-urlencoded
============= end =========================================
You could probably use the HttpClient module from apache to change the User-Agent field.
Ray
-- XML is the programmer's duct tape. .
- Follow-Ups:
- Re: Html download challenge
- From: sks
- Re: Html download challenge
- Prev by Date: Re: JFrame Resize Issues
- Next by Date: Re: Default timezone changes out of nowhere?
- Previous by thread: Re: Html download challenge
- Next by thread: Re: Html download challenge
- Index(es):
Relevant Pages
|