I have been able to capture the HTTP(s) traffic from a smartphone and also stored this traffic using mitmdump using the command
mitmdump -w outfile
You can extract any header fields you need, e.g., with mitmdump and the flow object (python inline scripts). Inline scripts are documented here: https://mitmproxy.org/doc/scripting/inlinescripts.html
To extract all headers, I used the following command:
$ mitmdump -n -q -s parse_headers.py -r .mitm
The parse_headers.py inline script is as follows:
def response(context, flow):
request_headers = [{"name": k, "value": v} for k, v in flow.request.headers]
response_headers = [{"name": k, "value": v} for k, v in flow.response.headers]
print request_headers
print response_headers