Bal*_*usC 31
检查HTTP Content-Type
响应头是否以image/
.
URLConnection connection = new URL("http://foo.bar/w23afv").openConnection();
String contentType = connection.getHeaderField("Content-Type");
boolean image = contentType.startsWith("image/");
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4709 次 |
最近记录: |