multipart和chunked protoccol之间的区别 [英] difference between multipart and chunked protoccol

查看:272
本文介绍了multipart和chunked protoccol之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些专家可以解释两者之间的差异吗?是不是chunked是流协议而多部分不是?使用multipart有什么好处?

Can some experts explain the differences between the two? is it true that chunked is a streaming protocol and multipart is not? what is the benefit of using multipart?

谢谢。

推荐答案

更直观地说,

分块是一种从服务器向客户端发送单个消息的方法,其中服务器不必等待生成整个响应但是可以在可用时发送碎片(块)。现在这发生在数据传输级别,并且对客户端无动于衷。适当地它是'Transfer-Encoding'类型。

Chunking is a way to send a single message from server to client, where the server doesn't have to wait for the entire response to be generated but can send pieces (chunks) as and when it is available. Now this happens at data transfer level and is oblivious to the client. Appropriately it is a 'Transfer-Encoding' type.

虽然多部分发生在应用程序级别并且在应用程序逻辑级别解释。在这里,服务器告诉客户端内容,即使它是一个响应主体,它具有不同的逻辑部分,并且可以相应地进行解析。再恰当地说,这是'Content-Type'的设置,因为客户应该知道它。

While Multi-part happens at the application level and is interpreted at the application logic level. Here the server is telling client that the content , even if it is one response body it has different logical parts and can be parsed accordingly. Again appropriately, this is a setting at 'Content-Type' as the clients ought to know it.

鉴于转移可以独立于内容类型进行分块,如果需要,可以使用服务器的分块编码传输-part http消息。

Given that transfer can be chunked independent of the content types, a multi-part http message can be transferred using chunked encoding by the server if need be.

这篇关于multipart和chunked protoccol之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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