--cookie
- CLI
- --cookie
- REST
- cookie
Sets a cookie, from a Set-Cookie-style string, before the page is requested. Repeatable.
Under --server it is a default for requests that send no cookie. Under --cdp it is set in each new browser context, and needs a Domain, since a context has no target URL.
Example
zshot -f page.png \
--cookie "theme=dark; Domain=zshot-cli.com" \
https://zshot-cli.com/example_assets/hello_zshot/{
"url": "https://zshot-cli.com/example_assets/hello_zshot/",
"output_type": "png",
"cookie": ["theme=dark; Domain=zshot-cli.com"]
}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","cookie":["theme=dark; Domain=zshot-cli.com"]}' \
-o page.png