Solved

Appache httpClient cannot access news.google.com (500pts)

Posted on 2004-04-25
5
297 Views
Last Modified: 2011-09-20
I've been trying and trying to set up the apache httpClient (org.apache.commons.httpclient) to be able to read news.google.com. The page it fetches is the autogen-ed forbiden page:

"Google Error
Forbidden
Your client does not have permission to get URL / from this server."

Does anyone know what the exact problem is and how to configure httpClient to avoid this?

I first thought it wouldn't be too hard but it proved otherwise. In addition, it's also pretty urgent so 500pts.

Thanks!
0
Comment
Question by:il68
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10914443
0
 
LVL 10

Accepted Solution

by:
Mercantilum earned 500 total points
ID: 10915981
I guess if you try from a common browser (ie, mozilla...) it works...

If you have no pb with the common browser, it is the configuration of httpclient which is causing problem, e.g. header or cookie...

For instance, curl (http://curl.haxx.se/) retrieve data from a http server (and others) and returns the same error (forbidden) since some data that is given by common browsers is missing.

1 - ensure your httpclient is able to manage cookie
2 - ensure the header is correct

Apache: this link is appropriate: http://jakarta.apache.org/commons/httpclient/  for httpclient

You could as well look at the packets sent to google from the free http://www.ethereal.com/ network analyzer when you use a common browser ; it will give you an idea of what you have to send to google.
0
 

Author Comment

by:il68
ID: 10933641
Thanks, looking at a trace was a great idea - it didn't like the httpClient's user agent header.
0
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10934570
Thanks - can I ask how you changed it finally?
0
 

Author Comment

by:il68
ID: 10954649
I haven't yet looked at what exactly it doesn't like - I was just trying it out with the fields that IE used to see which header was the problem.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Apache to Lighttpd 9 63
Duplicate Records In MySQL 7 49
htaccess file 3 66
PHP in Apache server 20 81
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now