Question

I have a strange problem...

I need to send a GET HTTP Request to web site by NSURLConnection ([NSURLConnection sendAsynchronousRequest...).

All works very well but sometimes I see a strange html result different from what I expect. This garbage html is this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> -->
<HTML><HEAD><META HTTP-EQUIV="Refresh" CONTENT="0.1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<TITLE></TITLE></HEAD><BODY><P></BODY>
</HTML>

(Lines split for clarity)

What does that mean?

The web site to which I refer is not mine so I can not work on the server side to solve the issue.

Can I do anything to prevent this?

Était-ce utile?

La solution

For some reason, the server (or an intermediary, like a load balancer) is asking you to make the request again in .1 seconds.

If you viewed this page with a web browser, it would wait .1 seconds, and then refresh the page (the purpose of the Refresh meta tag).

You will probably need to check explicitly for this, and retry your request (after waiting .1 seconds to be polite) when it happens.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top