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

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

问题描述

我正在编写一个响应HTTP重定向的webapp。有没有办法强制客户端转发我在新网址的响应中包含的标头?

I'm writing a webapp that reponses 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)

Webapp响应:

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天全站免登陆