Skip to content
Myr

simplify request dispatch flow

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 302c4d9 · Browse files · 1 file+8 added−5 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+8 added−5 removed

  • other:+8 added−5 removed

1 file+8 added−5 removed

modified:requests/models.py+8 added-5 removed
329 unmodified lines
330 self.config.get('verbose').write('%s %s %s\n' % (331 datetime.now().isoformat(), self.method, self.url332 ))333334334 # Build the URL335 url = self._build_url()336338337 # Attach uploaded files.338 if self.files:339 register_openers()340341 # Add form-data to the multipart.342 if self.data:343 self.files.update(self.data)344345 datagen, headers = multipart_encode(self.files)346 req = _Request(url, data=datagen, headers=headers, method=self.method)345 data, headers = multipart_encode(self.files)346347 else:349 req = _Request(url, data=self._enc_data, method=self.method)348 data = self._enc_data349 headers = {}350351 # Build the Urllib2 Request.352 req = _Request(url, data=data, headers=headers, method=self.method)353354 # Add the headers to the request.355 if self.headers:356 for k,v in self.headers.iteritems():357 req.add_header(k, v)358
340 unmodified lines