Python以及向urllib请求添加数据的新方法

时间:2014-09-08 22:40:08

标签: python urllib python-3.4

我收到了错误,

AttributeError: 'Request' object has no attribute 'add_data'

来自使用urllib.request的库

In Python 2.7-3.3 urllib.request contained a add_data() method.

但是在Python 3.4中,文档说明了

Changed in version 3.4: The request methods add_data, has_data, get_data, get_type, get_host, get_selector, get_origin_req_host and is_unverifiable that were deprecated since 3.3 have been removed.

如何在Python3.4中向urllib请求添加数据?

1 个答案:

答案 0 :(得分:7)