HarmonyOS webview怎么添加header

webview 请求链接时,怎么向 header中添加自定义字段

HarmonyOS
2024-12-25 14:42:20
821浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
put_get

可以写在web组件的生命周期里面 类似这样

Web({ src: '', controller: this.controller })
  .onControllerAttached(() => {
    this.controller.loadUrl("www.huawei.com", [{ headerKey: 'xx', headerValue: 'aa' }])
  • 1.
  • 2.
  • 3.

https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/web-event-sequence-V5#web组件网页加载的状态说明

分享
微博
QQ
微信
回复
2024-12-25 16:40:11
相关问题
Waterflow怎么添加header能力?
1097浏览 • 1回复 待解决
HarmonyOS 怎么给web组件的请求添加header
1205浏览 • 1回复 待解决
HamonyOS 设置webview的请求头header
1415浏览 • 1回复 待解决
HarmonyOS 统一设置webview的请求头header
1916浏览 • 1回复 待解决
服务中心添加卡片怎么添加
7672浏览 • 1回复 待解决
HarmonyOS埋点怎么添加
762浏览 • 1回复 待解决
HarmonyOS swiper怎么添加惯性
459浏览 • 1回复 待解决
buttom样式怎么添加
7408浏览 • 2回复 待解决
HarmonyOS Video 怎么添加请求头?
873浏览 • 2回复 待解决
HarmonyOS 网络请求header
693浏览 • 1回复 待解决
Image 上怎么添加文字?
3980浏览 • 1回复 待解决
HarmonyOS WebView容器怎么debug调试
801浏览 • 1回复 待解决
HarmonyOS Tabs组件怎么动态添加TabContent
1029浏览 • 1回复 待解决