Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-04-25
5
Medium Priority
?
305 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10914443
0
 
LVL 10

Accepted Solution

by:
Mercantilum earned 2000 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

704 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