如何在 HTTP 重定向上转发标头 [英] How to forward headers on HTTP redirect

查看:37
本文介绍了如何在 HTTP 重定向上转发标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个响应 HTTP 重定向的 web 应用程序.有没有办法强制客户端将我在响应中包含的标头转发到新网址?

I'm writing a webapp that responses an HTTP redirect. Is there a way to force the client to forward the headers I include in the response to the new url?

示例请求:

POST /insertion HTTP/1.1
Content-Length: 9

(content)

Web 应用响应:

HTTP/1.x 302 Found
Location: /dock
Mydata: asdf

下一个客户请求:

GET /dock HTTP/1.1
Mydata: asdf

更新:看来我对此事并不清楚.我知道 cookie 会很有用,但我不能使用它们.你知道我正在寻找的东西是否存在吗?

Update: It seems I wasn't clear on the matter. I know cookies would be useful, but I can't use them. Do you know whether exists something like what i'm searching for?

推荐答案

除了 HTTP cookie 之外,协议规范中没有关于转发标头的任何内容.客户端需要实现此功能.

Other than HTTP cookies, there's nothing in the protocol specification about forwarding headers. The client needs to implement this functionality.

这篇关于如何在 HTTP 重定向上转发标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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