--header
- CLI
- --header, -H
- REST
- header
Sends a header, as Name: value, on each main-frame navigation within the target’s registrable domain. Repeatable.
Scope
The header follows a crawl or navigator session across same-site pages and subdomains. Subresource requests and navigations to another registrable domain go without it, so it never reaches third-party hosts. Cookies from --cookie follow cookie-jar rules instead and reach any matching request.
Under --server it is a default for requests that send no header. Under --cdp it is ignored; set headers from the CDP client, such as with Network.setExtraHTTPHeaders.
Example
zshot -f page.png \
-H "X-Internal-Header: true" \
https://zshot-cli.com/example_assets/hello_zshot/{
"url": "https://zshot-cli.com/example_assets/hello_zshot/",
"output_type": "png",
"header": ["X-Internal-Header: true"]
}curl -X POST http://127.0.0.1:3000/ \
-H "Content-Type: application/json" \
-d '{"url":"https://zshot-cli.com/example_assets/hello_zshot/","output_type":"png","header":["X-Internal-Header: true"]}' \
-o page.png