In my web app I’m making a CURL call to Google’s (unofficial) weather API at:
http://www.google.com/ig/api?weather=,,, ...
This works fine in all cases except when the page involved is accessed in Opera. When accessed in Opera, instead of the weather I get the following in the xml response:
301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/m/ig">here</A>.
How can I fix this? I’ve seen some suggestions around the web that clearing the cache is a solution, but that hasn’t worked for me. Note I’m particularly concerned with Opera Mini.
Thanks a lot.
Update 2012-06-20: Tested with Opera 12 and Google has fixed the sniffing issue it seems.
I do not think you can fix it. It would be interesting to know why Google does server-side user agent sniffing and redirects Opera to another URI. Could you paste the full weather URI, so we can test it at Opera ourselves? If do a get of the one you have given into Opera I get
I also do not get a redirection, but I guess it is because the URI is not the one you have used.
More details will help, and I will complete here.
Update 2012-03-12 First I tried with a simple curl.
Then with Opera User agent.
And finally with Firefox User Agent
There is a no
X-Content-Type-Options: nosniffin all cases and no redirection. What is the user agent you are using. You can type about:opera in the addressbar and the user agent string will appear.