多部分协议和分块协议之间的区别 [英] difference between multipart and chunked protocol

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

问题描述

一些专家可以解释两者之间的区别吗?分块是流协议,多部分不是流协议,这是真的吗?使用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?

推荐答案

更直观地

分组是一种从服务器向客户端发送单个消息的方法,服务器不必等待整个响应的生成,而是可以在可用时发送片段(块).现在,这发生在数据传输级别,并且客户端忽略了.适当地,它是传输编码"类型.

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.

鉴于传输可以独立于内容类型进行分块,因此如果需要,服务器可以使用分块编码来传输多部分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.

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

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