Solved

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

Posted on 2004-04-25
5
301 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATEā€¦
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scannerā€¦

679 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