Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » httpclient : problem with some permanently redirected pages
httpclient : problem with some permanently redirected pages [message #31752] Thu, 24 March 2011 15:34 Go to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Is it a bug ? The httpcli example doesn't work with this url :
http://www.worldcat.org/oclc/40350907?referer=xid


I suppose that it's because this is a redirected page, and the location is a relative address :
/title/tagalog-english-english-tagalog-dictionary-talatinigang-pilipino-inggles-inggles-pilipino/oclc/40350907?referer=xid


I tried with some others redirected pages, it's working fine and all have a complete location address, ie :
http://www.domain.tld/newpage.html


If it's not a bug, how can I do to get the new page ? For now, using this code
Httpclient c;
String url = http://www.worldcat.org/oclc/40350907?referer=xid;
c.URL(url);
String content = c.ExecuteRedirect();
puts("[error] " + Nvl(client.GetError(), "OK (no error)"));

I get an error
[error] gethostbyname(): Connection timed out

Re: httpclient : problem with some permanently redirected pages [message #31755 is a reply to message #31752] Thu, 24 March 2011 17:41 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
I'm really not sure, but aren't redirect URIs supposed to be absolute according to norm?

I'm not saying the code can't handle relative URIs as well, but if it's defined in norm as absolute only, it's partly bug in the web page too, not only code.

Sorry, no time to verify anything of this today. Wink
Re: httpclient : problem with some permanently redirected pages [message #31764 is a reply to message #31752] Fri, 25 March 2011 09:33 Go to previous message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi mr_ped,

Yes, I was also surprised to see this relative redirection : It's the first time I see that, and I was also thinking that it's not RFCs compliant !

I'll see later the RFC. For now, I have to find a way to get this page...
Previous Topic: XML Parsing
Next Topic: Examples Error
Goto Forum:
  


Current Time: Fri Apr 26 04:38:03 CEST 2024

Total time taken to generate the page: 2.90547 seconds