httplib2 post 问题

来源:互联网 发布:剑三毒姐妖娆捏脸数据 编辑:程序博客网 时间:2024/06/13 07:47
            h = httplib2.Http(".cache")            body = {"proxy_id": t.imei, "uid": pk, "device": "O", "status": "",                    "start": "", "end": "", "cellphone": ""}            tb = urlencode(body)            # 经多次测试必须带上headers参数,否则POST的数据(body)内容传不上去            headers = {'Content-type': 'application/x-www-form-urlencoded'}
            response, result = h.request("http://xxx.com/service", method="POST", body=tb, headers=headers)

1 0
原创粉丝点击