开发者

Saving Images without knowing Mime Type

开发者 https://www.devze.com 2023-03-25 18:52 出处:网络
I am using http://img.tweetimag.es/ to pull twitter avatars. EX: http://img.tweetimag.es/i/joestump_o How do I know the correct mime type (开发者_如何学运维jpg, png, gif, etc.) to save locally?

I am using http://img.tweetimag.es/ to pull twitter avatars.

EX: http://img.tweetimag.es/i/joestump_o

How do I know the correct mime type (开发者_如何学运维jpg, png, gif, etc.) to save locally?

Any help would be great, thanks.

JP


Look at the content type of the HTTP GET request. For your example:

Content-Type: image/png


Here are some values you can retrieve, as mentioned in @kgiannakakis answer, take a look at Content-Type:

http://img694.imageshack.us/img694/2144/unledofv.png

0

精彩评论

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