Creating and exporting a simulation¶
If you are running Hoverfly on a machine that accesses the internet via a proxy (for example if you are on a corporate network), please follow the Using Hoverfly behind a proxy tutorial before proceeding.
Start Hoverfly and set it to Capture mode
hoverctl start hoverctl mode capture
Make a request with cURL, using Hoverfly as a proxy server:
curl --proxy http://localhost:8500 http://time.jsontest.com
View the Hoverfly logs
Export the simulation to a JSON file
hoverctl export simulation.json
You’ll now see a
simulation.json file in your current working directory, which contains all your simulation data.
In case you are curious, the sequence diagram for this process looks like this:
By default, request headers are not captured. If you want to capture headers, you will need to specify them when setting capture mode.
hoverctl mode capture --headers "User-Agent,Content-Type,Authorization" hoverctl mode capture --all-headers