简体   繁体   English

如何在HTML对象标签中传递请求标头?

[英]How to pass request headers in HTML object tag?

I am trying to embed HTML page from a web application in my website using object tag. 我正在尝试使用对象标记将Web应用程序中的HTML页面嵌入到我的网站中。 Both website and the web application's HTML page are hosted in same domain. 网站和Web应用程序的HTML页面都位于同一域中。 I am trying to pass cookie information(basically jsessionid) from my website to the web application's HTML page. 我正在尝试将Cookie信息(基本上是jsessionid)从我的网站传递到Web应用程序的HTML页面。 I tried with embedding it in url, but the information is not getting passed. 我尝试将其嵌入url中,但信息没有通过。 Is there any alternative to achieve this or i am doing it in wrong way? 是否有其他选择可以实现这一目标,或者我做错了方法? Kindly direct me to the right way to achieve this. 请指导我实现此目标的正确方法。

There is no way to set arbitrary HTTP headers when requesting content using an <object> . 使用<object>请求内容时,无法设置任意HTTP标头。

The only time you can add HTTP headers is when using XMLHttpRequest or fetch but in those cases the cookie headers are protected and you cannot set them. 唯一可以添加HTTP标头的时间是在使用XMLHttpRequestfetch但是在这种情况下,cookie标头受到保护,因此无法设置它们。

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

相关问题 如何传递XMLHttpRequest请求的标头 - How to pass headers for an XMLHttpRequest request 如何将令牌传递给 JQGrid 中的请求标头 - How to pass a Token to Request Headers in JQGrid 在JS处理DOM并传递请求标头之后,获取生成的HTML - Get generated HTML after JS manipulates the DOM and pass request headers 如何添加自定义标题以请求html页面? - How to add custom headers to request html page? 如何将带有标题的 url 传递给 img 标签(src 属性) - how to pass url with headers to an img tag (src attribute) 如何将对象或变量值从html脚本标签传递到angular的控制器 - how to Pass a object or a variable value from html script tag to the controller of angular 如何在 for 循环的每次迭代中将 HTML 标记中的值传递给 Vue 的数据 object - How do I pass a value from an HTML tag to Vue's data object on each iteration of a for loop 如何将 JSON Object 键值对传递到 HTML href 标签? - How to pass JSON Object key-value pair into HTML href tag? 如何在反应中将请求标头从 express 传递到 index.js? - How to pass request headers from express to index.js in react? 如何使用异步节点库传递请求标头? - How to pass request headers using async node library?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM