Is using the HTTP Content-Range header appropriate when sending a file in chunks using the POST method?

后端 未结 2 1158
时光说笑
时光说笑 2021-01-07 01:13

I am working on an existing Silverlight file uploader that breaks files into multiple chunks and transmits the file using multiple HTTP requests.

Currently, it sends

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-07 01:46

    Probably not, at least as of 2014 (the original answer is from 2011).

    The updated HTTP 1.1 specification, rfc7231 (4.3.3), says the following about valid POST responses:

    An origin server indicates response semantics by choosing an appropriate status code depending on the result of processing the POST request; almost all of the status codes defined by this specification might be received in a response to POST (the exceptions being 206 (Partial Content), 304 (Not Modified), and 416 (Range Not Satisfiable)).

    Given that this language was explicitly added to the updated spec, I doubt the authors intended that the Content-Range header be used with the POST method.

提交回复
热议问题