2015-12-11 69 views

回答

2

嘗試curl -I <url>。這應該顯示標題,特別是服務器發送的Content-Type

例子:

> curl -I "https://www.gravatar.com/avatar/fd43775c1ea617f12187cab9785ef2d0?s=32&d=identicon&r=PG&f=1" 

HTTP/1.1 200 OK 
Accept-Ranges: bytes 
Access-Control-Allow-Origin: * 
Cache-Control: max-age=300 
Content-Type: image/png 
Date: Mon, 14 Dec 2015 09:48:41 GMT 
Expires: Mon, 14 Dec 2015 09:53:41 GMT 
Last-Modified: Wed, 11 Jan 1984 08:00:00 GMT 
Link: <https://www.gravatar.com/avatar/fd43775c1ea617f12187cab9785ef2d0?s=32&d=identicon&r=PG&f=1>; rel="canonical" 
Server: ECS (fcn/9F89) 
Source-Age: 140 
Via: 1.1 varnish-v4 
X-Cache: HIT 
X-Varnish: 336435067 334859069 
Content-Length: 768 

請注意,由服務器發送的內容類型並不一定是真正的內容類型。

+0

它不適用於https網址 – oliver

+0

@ user3929135:那麼請擴展或修復您問:祝您好運。 – shellter

+0

@ user3929135提供示例網址 – NaN