--network-log
- CLI
- --network-log
- REST
- with_network_log
Writes a JSON log of the page’s network requests alongside the render: when each started and completed, with its status, content type and size. On the server, the log is returned as a Link response header.
Example Output
{
"url": "https://zshot-cli.com/example_assets/hello_zshot/",
"log": [
{
"type": "start",
"timestamp_ms": 0,
"url": "https://zshot-cli.com/example_assets/hello_zshot/",
"outcome": "allowed"
},
{
"type": "complete",
"timestamp_ms": 222,
"url": "https://zshot-cli.com/example_assets/hello_zshot/",
"duration_ms": 222,
"http_status": 200,
"content_type": "text/html",
"bytes_received": 504
},
{
"type": "start",
"timestamp_ms": 223,
"url": "https://zshot-cli.com/example_assets/hello_zshot/style.css",
"outcome": "allowed"
},
{
"type": "complete",
"timestamp_ms": 428,
"url": "https://zshot-cli.com/example_assets/hello_zshot/style.css",
"duration_ms": 204,
"http_status": 200,
"content_type": "text/css",
"bytes_received": 1385
}
]
}Example
zshot -f page.png \
--network-log page.network.json \
https://zshot-cli.com/example_assets/hello_zshot/{
"url": "https://zshot-cli.com/example_assets/hello_zshot/",
"output_type": "png",
"with_network_log": 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","with_network_log":true}' \
-D - -o page.png