How to modify http request header when android chrome open new page

when i try modify http request header for android chrome browser open new page,I encountered some difficulties, there is some way to do that,according to chrome devtool ,code as follows:

driver.execute_cdp_cmd('Fetch.enable', {
    'patterns': [{
        'urlPattern': url+"*",  # 匹配主页请求的 URL
        'resourceType': 'Document'  # 只拦截页面请求
    }]
})

now ,the question is i do not know listen cdp event ,appium provide that?

Fetch Domain
A domain for letting clients substitute browser's network layer with client code.
Methods
Fetch.continueRequest
Fetch.continueWithAuth
Fetch.disable
Fetch.enable
Fetch.failRequest
Fetch.fulfillRequest
Fetch.getResponseBody
Fetch.takeResponseBodyAsStream
Fetch.continueResponse Experimental
Events
Fetch.authRequired
Fetch.requestPaused
Types
Fetch.AuthChallenge
Fetch.AuthChallengeResponse
Fetch.HeaderEntry
Fetch.RequestId
Fetch.RequestPattern
Fetch.RequestStage

how do i know these events for python appium client

try examples e.g. → Selenium DevTools for Advanced Chrome Automation | BrowserStack

appium can do that ?

Appium just sending command from language you wrote (python, java …) to driver in use.

I believe in order to make CDP work with Android Chrome you’d need to do a bit more than what “classic” Selenium provides. Please check bug: websocket close unexpectedly · Issue #20760 · appium/appium · GitHub, where the person uses the devtools plugin to make that feature work