Modifying requests with mitmproxy

I was recently reverse-engineering parts of the OpenTable API, and wasn't sure how to refresh the Bearer token. We can get the initial one by going through a number of requests: https://mobile-api.opentable.com/oauth/consumer/token to get a logged out token, then through https://mobile-api.opentable.com/api/v1/2fa/start and https://mobile-api.opentable.com/api/v1/2fa/confirm to authenticate…