Skip to content
Myr

send file name

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 1c5ce72 · Browse files · 1 file+6 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−3 removed

  • other:+6 added−3 removed

1 file+6 added−3 removed

modified:requests/models.py+6 added-3 removed
246 unmodified lines
247 if self.files:248 if not isinstance(self.data, basestring):249 fields = self.data.copy()250 for (k, v) in self.files.items():251 fields.update({k: (None, v.read()))251 fields.update({k: (k, v.read())})252 (body, content_type) = encode_multipart_formdata(fields)253254 # Setup form data.255 if self.data and (not body):256 if isinstance(self.data, basestring):257 body = self.data258 else:259 body = urlencode(self.data)259 body = encode_params(self.data)260 content_type = 'application/x-www-form-urlencoded'261262 # Setup cookies.263 elif self.cookies:264 pass265266 if (content_type) and (not 'content-type' in self.headers):267 self.headers['Content-Type'] = content_type268269 # Only send the Request if new or forced.270 if (anyway) or (not self.sent):271272 try:
25 unmodified lines
298 # Create the connection.299 r = connection.urlopen(300 method=self.method,301 url=url,299 body=self.data,302 body=body,303 headers=self.headers,304 redirect=False,305 assert_same_host=False,306 preload_content=do_block,
163 unmodified lines