如果我执行以下 Groovy 代码
URL url = new URL('http://glowstick.blisstunes.com/wp-content/plugins/rss-poster/cache/e1ebf_josh-wink.jpg')
ImageIO.read(url)
我得到一个例外:
javax.imageio.IIOException: Can't get input stream from URL!
at javax.imageio.ImageIO.read(ImageIO.java:1369)
但是如果我在浏览器中访问 URL,图像就会显示出来。是因为 HTTP 请求被阻止是因为它(从标头)看起来不像来自浏览器吗?