In my application how can i check whether internet connection is available or not using ASIHTTP
In my application how can i check whether internet connection is available or not . Depending th开发者_运维知识库e result i want to display some notification to the user ...... and after retrying 2 or 3 times ..want to exit my aplication . how can i do it .. i am using ASIHTTP libraries ....
If you are using a standard HTTP library (it seems that the purpose of the ASIHTTP library) for your program, you can try to connect and use a HTTP HEAD/GET request onto a commonly used HTTP server (e.g. google.com).
Based on the answers (HTTP 200 return code), you can guess if the user got a working Internet connectivity.
Such test has some drawbacks like when a user as a transparent HTTP proxy that would give a proper 200 return code but not from the remote server.
精彩评论