简体   繁体   English

编辑HTTP标头连接

[英]Edit HTTP header connection

Is there a way to edit the HTTP header "connection" in MVC. 有没有一种方法可以在MVC中编辑HTTP标头“连接”。 I tried the Add and AppendHeader functions; 我尝试了AddAppendHeader函数; they all work, but you cannot edit the connection header. 它们都可以,但是您不能编辑连接头。

I know that MVC provides certain standard HTTP headers to be modified by making some of the header values a public variable of that request for editing, such as StatusCode , but is there a way to edit the connection? 我知道MVC提供了某些标准的HTTP标头,可以通过将某些标头值设置为该编辑请求的公共变量(例如StatusCode来进行修改,但是有没有办法编辑连接?

You can't really change/set headers on incoming request ("connection" is set by client side of the request, usually browser). 您实际上不能更改/设置传入请求的标头(“连接”是由请求的客户端(通常是浏览器)设置的。 You can add such header to response, but it will have no meaning to either side (server or browser) 您可以将此类标头添加到响应中,但对任何一方(服务器或浏览器)都没有任何意义

HTTP/1.1 - Header Filed Definituions - Connection: HTTP / 1.1-头文件定义 -连接:

The Connection general-header field allows the sender to specify options that are desired for that particular connection 连接通用标题字段允许发送者指定该特定连接所需的选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM