I get an error message
AttributeError: 'Request' object has no attribute 'add_data'
from a library that uses urllib.request
In Python 2.7-3.3, urllib.request contains a method add_data().
add_data()
But in Python 3.4, the documentation states that
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, which were deprecated since the removal of 3.3.
How to add data to urllib requests in Python3.4?
Just assign an attribute datato urllib.request.
data
urllib.request
request.data = "Some data"