I feel obliged to mention Fiddler. The tool I loved almost 20 years back and felt like it came from future. IIRC it was/is more powerful than Charles. Fiddler was Windows only but at one time they had builds for other platforms in works. Sadly they got acquired which changed their roadmap, and I had also moved on from Windows.
This. I tell people tales of that beautiful tool. have you found anything for a MacOS? My hunt so far has been futile.
https://proxyman.com/
For macOS settled on Charles back then but not as capable as Fiddler.
Proxyman is great.
The fiddler landing page says it runs on Windows, macOS, and Linux, so maybe give it another try.
The original thing is now called Fiddler Classic and it is still Windows only. Not maintained anymore, sadly. It has first class scripting support.
I still use Fiddler Classic, at least once a week when I need to dig-in on a problem. It occasionally gets an update though I can't remember the last time it did.
It's so powerful, especially with the JScript scripting language. Such a powerful tool.