使用POST方法以块的形式发送文件时,是否使用适当的HTTP Content-Range标头? [英] Is using the HTTP Content-Range header appropriate when sending a file in chunks using the POST method?

查看:215
本文介绍了使用POST方法以块的形式发送文件时,是否使用适当的HTTP Content-Range标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个现有的Silverlight文件上传器,它将文件分成多个块并使用多个HTTP请求传输文件。

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 the start and total byte information on the querystring, but as learning exercise, I'd like to use a more standards-based approach.

我之前使用过HTTP Content-Range标题实现提供内容的端点时在将内容从客户端发布到服务器时,此标题是否也适用?

I've previously used the HTTP Content-Range header when implementing an endpoint that serves content. Is this header also appropriate to use when posting content from a client to the server?

推荐答案

是。

RFC 2616(HTTP 1.1),第14节首先说明:


对于实体标题字段,发件人和收件人都指客户或
客户端或服务器,取决于谁发送和谁收到
实体。

For entity-header fields, both sender and recipient refer to either the client or the server, depending on who sends and who receives the entity.

除此之外,第14.16节,定义了Content-Range标头,似乎不包含任何语言将其使用限制在请求或响应中。

Other than that, Section 14.16, which defines the Content-Range header, does not appear to contain any language limiting its use to either the request or response.

这篇关于使用POST方法以块的形式发送文件时,是否使用适当的HTTP Content-Range标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆