twitter app - how does it know when a link is an image?
In both the iPhone and Mac Twitter app, if you click on a link and its an image, it opens the image up in a special window. How is this done internally? How does it know 开发者_如何转开发that that link points to an image?
Do they search for file endings and work it out from there? I thought it maybe a field in the API feed, but can't find anything?.
Most probably it will check for the Content-Type header which gives the MIME-type of the data in the body, such as text/html,image/gif,application/rss etc, then if it is an image type, then opens it in a special window.
精彩评论