I have httptoolkit capturing some traffic. I would like to access the responses of that traffic in another application. Is there anyway I can get httptoolkit to write out the traffic it gets to a file? Or someway I can access the traffic from another application?
1 Answers
HTTP Toolkit doesn't directly offer programmatic access to intercepted traffic. You can manually export traffic to a HAR file (with Pro) to process it elsewhere, but not automatically.
In most cases like this, the best solution right now is to forward traffic upstream from HTTP Toolkit via a custom Mockttp proxy (the internals from HTTP Toolkit, but available as a standalone library) and then configure advanced logic in that custom proxy to listen for the events your interested in. Using Mockttp, you can handle and log traffic programmatically any way you like. There's a walkthrough here: https://httptoolkit.com/blog/javascript-mitm-proxy-mockttp/
In future, there are plans to create a 'save to HAR' rule built into HTTP Toolkit that would save all matching traffic automatically, but that's not available yet: https://github.com/httptoolkit/httptoolkit/issues/342

- 11,766
- 1
- 57
- 85