There’s also an excellent mitmproxy-based tool that does exactly that: https://dutzi.github.io/tamper/