简体   繁体   English

客户端上的 HTTP 响应标头

[英]HTTP response headers over clients

So I am little confused on the behaviour of HTTP headers.所以我对 HTTP 标头的行为有点困惑。 My question is:我的问题是:

If I am running an API off a server.如果我在服务器上运行 API。 If a client makes a request, and i respond to the client via the server by setting a header in the form of:如果客户端发出请求,我通过服务器通过设置 header 以下列形式响应客户端:

response.header.<some_header> = <some_value>

will this header persist for all clients (ie some computer, and then another computer, etc), or is this header response unique to the client making the request?这个 header 是否会持续存在于所有客户端(即一些计算机,然后是另一台计算机等),或者这个 header 响应是否对发出请求的客户端唯一?

Thanks!!谢谢!!

The response object is only sent to the client that made a request in the first place. response object 仅发送给首先发出请求的客户端。 In fact you said the answer in your question yourself:实际上,您自己在问题中说了答案:

"If a client makes a request, and I respond to the client via the server" “如果客户端发出请求,我通过服务器响应客户端”

In general if a client made a request, the server can only respond the the client that made the request.一般来说,如果客户端发出请求,服务器只能响应发出请求的客户端。 Hope this answers your question.希望这能回答你的问题。 For more information on http headers you should read this .有关 http 标头的更多信息,您应该阅读内容。

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

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