無法讓 Content-Range 請求在 IIS7 和 IIS8 中工作

無法讓 Content-Range 請求在 IIS7 和 IIS8 中工作

我正在對 IIS7 和 IIS8 伺服器執行相同類型的請求,但我不斷收到此訊息第416章回覆

$ curl-7.23.1-win64-ssl-sspi>curl -H Range:bytes=16- -I http://my.local.host/dotnetrocks_0813_syme_battochi.mp3

HTTP/1.1 416 Requested Range Not Satisfiable  
Content-Length: 45740117  
Content-Type: audio/mpeg  
Last-Modified: Wed, 24 Oct 2012 09:14:29 GMT  
Accept-Ranges: bytes  
ETag: "97ab9ff8c7b1cd1:0"  
Server: Microsoft-IIS/8.0  
X-Powered-By: ASP.NET  
Date: Tue, 30 Oct 2012 18:54:31 GMT  
Content-Range: bytes */0

該範圍顯然在文件大小之內,但我仍然沒有得到206回覆.我在這裡缺少什麼?

答案1

我遇到了同樣的問題,並在其中找到了答案https://stackoverflow.com/questions/18882776/curl-default-get-request-isnt-recognized-by-php

摘要:指定僅標頭選項-I會導致請求方法 HEAD。透過指定選項來強制 GET 代替-X

例子: curl -H Range:bytes=16- -I -X GET http://my.local.host/dotnetrocks_0813_syme_battochi.mp3

相關內容