WebRequest API 列表
本模块包含 8 个 API。
Methods(方法)
| API | 说明 | 鸿蒙支持 |
|---|---|---|
| webRequest.onBeforeRequest | 在请求发出前拦截,可将请求重定向到指定 URL;若 frame 已导航或销毁后访问则为 null。 | 支持 |
| webRequest.onBeforeSendHeaders | 在发送请求头前拦截,可修改请求头;若 frame 已导航或销毁后访问则为 null。 | 支持 |
| webRequest.onSendHeaders | 在请求头发送时触发监听;若 frame 已导航或销毁后访问则为 null。 | 支持 |
| webRequest.onHeadersReceived | 在收到响应头时拦截,可修改响应头;若 frame 已导航或销毁后访问则为 null。 | 支持 |
| webRequest.onResponseStarted | 在收到响应体第一个字节时触发,包括来自缓存的响应;若 frame 已导航或销毁后访问则为 null。... | 支持 |
| webRequest.onBeforeRedirect | 在服务器发起重定向前触发,可获取实际发送的目标地址;若 frame 已导航或销毁后访问则为 null... | 支持 |
| webRequest.onCompleted | 在请求完成时触发监听;若 frame 已导航或销毁后访问则为 null。 | 支持 |
| webRequest.onErrorOccurred | 在请求发生错误时触发监听;若 frame 已导航或销毁后访问则为 null。 | 支持 |