Capture HTTP traffic and auto-generate hitspec test files using the recording proxy.
The recording proxy captures HTTP requests and responses flowing through it, then exports them as .http files. It is a fast way to bootstrap tests from existing API traffic.
# Start recording proxyhitspec record --port 8080 --target https://api.example.com# In another terminal, send requests through the proxycurl http://localhost:8080/userscurl -X POST http://localhost:8080/users -d '{"name":"John"}'# Press Ctrl+C to stop and export
The exported .http file follows standard hitspec format:
Copy
### GET /users# @name get_usersGET https://api.example.com/usersAccept: application/json>>>expect status == 200<<<### POST /users# @name post_usersPOST https://api.example.com/usersContent-Type: application/json{ "name": "John"}>>>expect status == 200<<<
After recording, edit the generated file to add meaningful assertions, replace hardcoded values with variables, and add @depends directives for request ordering.