HTTP 1xx 状态代码

发布于 2024-07-29 21:34:06 字数 148 浏览 5 评论 0原文

你们中有人见过现实生活中出现的 HTTP“Expect”标头吗? 或者任何代理或服务器回答“100 继续”状态消息? 流行的 HTTP 服务器(例如 IIS 或 Apache)是否遇到过返回“100 Continue”的情况?

谢谢, 最大限度

Does anyone of you has ever seen a real life occurence of the HTTP "Expect" header?
Or any proxy or server answering with a "100 Continue"-Status Message?
Do popular HTTP servers like IIS or Apache ever encounter situations where a "100 Continue" is returned?

Thanks,
Max

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦里梦着梦中梦 2024-08-05 21:34:08

.net System.Net.HttpWebRequest默认情况下每个帖子请求。 Tomcat 在执行 servlet 之前至少会发送 100-Continue。

The .net System.Net.HttpWebRequest sends an Expect: 100-continue on every post request by default. Tomcat, at least, sends a 100-continue before executing the servlet.

筑梦 2024-08-05 21:34:08

是的,Expect: 100-Continue 由 .NET 中的 System.Net.HttpWebRequest 使用,并且所有现代 Web 服务器都可以识别它(它是 HTTP/1.1 标准的一部分)。

它主要在通过 POST 上传文件时使用(但可以与任何 POST 请求一起使用),以便客户端在发送潜在的大数据之前知道请求是否可以成功。

100-Continue 响应并不意味着请求会成功,它意味着服务器已经知道的参数是可以的(例如:它不会抛出 4xx 代码),并且如果其余的也可以,那么请求就会成功。

Yes, Expect: 100-Continue is used by System.Net.HttpWebRequest in .NET, for example, and all modern web servers recognize it (it's part of the HTTP/1.1 standard).

It is used mainly when a file is uploaded via POST (but can be used with any POST request), so that the client can know if the request can be successful before sending the potentially big data.

A 100-Continue response does not mean the request WILL be successful, it means that the parameters the server already knows are ok (eg: it won't throw a 4xx code, for example), and if the rest is ok as well, then the request will be successful.

妄想挽回 2024-08-05 21:34:07

如果 POST 请求的内容超过 1024 字节,libcurl 将添加“Expect: 100-Continue”标头。

至少自 2003 年起,SUN 拒绝向 servlet API 添加对此标头的支持。 Servlet 容器内的 Java Web 应用程序无法控制 100 个继续响应。

每当收到“Expect: 100-Continue”时,大多数 servlet 容器实现都会立即发送此响应。

libcurl will add the "Expect: 100-Continue" Header if the content of a POST request exceeds 1024 bytes.

At least since 2003 SUN refuses to add support for this header to the servlet API. Java web application inside servlet containers have no ability to control 100 Continue responses.

Most servlet container implementations will immediately send this response whenever an "Expect: 100-Continue" is received.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文