修改“custom”中的requestHeaders delphi 浏览器
我的 deplhi 应用程序 (IE) 中集成了一个浏览器。我需要调用某个 Web 应用程序,并且需要在标头中为来自应用程序浏览器的所有请求附加一个新变量,例如 jquery 将 HTTP_X_REQUESTED_WITH
参数添加到 xhrobj 中。我知道如何才能做到这一点吗?代码示例会很棒。我正在使用TWebBrowser
。
I have a browser integrated in my deplhi application (IE). I need to call a certain web app and I need to append a new variable in the header for all the requests that come from my application's browser, like jquery adds to the xhrobj the HTTP_X_REQUESTED_WITH
parameter. Any idea on how can I do that? code samples would be great. I am usin TWebBrowser
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
OnBeforeNavigate2
事件修改标头:You can modify the headers with the
OnBeforeNavigate2
event:IWebBrowser2.Navigate 有一个参数,可让您定义其他标头。
IWebBrowser2.Navigate has a parameter that lets you define additional headers.