Name

add_data

Synopsis

                           r.add_data(data)

Sets data as r’s data. Calling urlopen( r ) then becomes like calling urlopen( r,data ), i.e., it requires r’s scheme to be http, and uses a POST request with a body of data, which must be a URL-encoded string.

Despite its name, method add_data does not necessarily add the data. If r already had data, set in r’s constructor or by previous calls to r .add_data, the latest call to r .add_data replaces the previous value of r’s data with the new given one. In particular, r .add_data(None) removes r’s previous data, if any.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.