且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用 GWT 检查给定的图像 URL 是否存在?

更新时间:2023-11-26 11:42:22

您可以使用 RequestBuilder 来做到这一点——只需请求图像 URL,使用 Response's getHeaders() 方法获取内容类型,并检查它是否是图像.

You could do this with a RequestBuilder -- just request the image URL, use the Response's getHeaders() method to get the content type, and check if it's an image.