为什么不支持IIS块传输编码? [英] Why doesn't IIS support chunked transfer encoding?

查看:119
本文介绍了为什么不支持IIS块传输编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提出一个HTTP连接到IIS Web服务器和发送使用Transfer-Encoding的EN $ C $光盘的数据的POST请求:分块。当我这样做,只是IIS关闭连接,没有任何错误信息或状态code。按照 HTTP 1.1规范


  

所有HTTP / 1.1应用程序必须能够接收和德code中的分块传输编码


所以我不明白为什么这是(一)不处理该编码和(B)这不是发回一个状态code。如果我更改请求发送的内容长度,而不是传输编码,查询成功,但是这并不总是可行的。

当我尝试对阿帕奇同样的事情,我得到一个411需要长度状态和一条消息说分块传输编码禁止。

为什么这些服务器不支持这种编码?


解决方案

我的理解是分块编码只能在一个HTTP响应中使用。分块请求机构将具有作为不相容用1.0服务器的属性,并且在任何情况下,就没有一个用户代理知道该服务器是一个1.0服务器,直到它已经发送的请求的方式。

但我同意目前还不清楚从文档。

I am making an HTTP connection to an IIS web server and sending a POST request with the data encoded using Transfer-Encoding: chunked. When I do this, IIS simply closes the connection, with no error message or status code. According to the HTTP 1.1 spec,

All HTTP/1.1 applications MUST be able to receive and decode the "chunked" transfer-coding

so I don't understand why it's (a) not handling that encoding and (b) it's not sending back a status code. If I change the request to send the Content-Length rather than Transfer-Encoding, the query succeeds, but that's not always possible.

When I try the same thing against Apache, I get a "411 Length required" status and a message saying "chunked Transfer-Encoding forbidden".

Why do these servers not support this encoding?

解决方案

My understanding is that chunked encoding can only be used in a HTTP response. A chunked request body would have the property of being incompatible with a 1.0 server, and in any case, there would be no way of a user-agent knowing that the server was a 1.0 server until it had already sent the request.

But I agree it's unclear from the documentation.

这篇关于为什么不支持IIS块传输编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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