March 2003
Intermediate to advanced
656 pages
39h 30m
English
add_data
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.