开发者

twitter app - how does it know when a link is an image?

开发者 https://www.devze.com 2023-03-22 06:59 出处:网络
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 lin

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消