requests批量输出,如何只输出特定的参数

#-*- coding:utf-8 -*-
import requests
import datetime

url = 'http://httpbin.org/post'

base_date = datetime.datetime(2016, 4, 1)
base_payload = {'headers': ''}

for i in range(1, 10):
    payload = base_payload.copy()
    payload.update({
        'index': i,
        'data': (base_date + datetime.timedelta(days=i)).strftime('%Y-%m-%d')
    })
    response = requests.post(url, data=payload)
    with open ('a.text'.format(i), 'a') as fp:
        fp.write(response.text)

上面的是全部输出

现在只需要输出form的内容就可以
比如

[
    {
        "form": {
            "data": "2016-04-02",
            "headers": "",
            "index": "1"
        },
        "data": "2016-04-03",
        "headers": "",
        "index": "2"
    }
]
查看回复