Lazily encode data, params, files
authorIdan Gazit <idan@gazit.me>
Wed, 2 May 2012 21:04:13 +0000 (00:04 +0300)
committerIdan Gazit <idan@gazit.me>
Wed, 2 May 2012 21:04:13 +0000 (00:04 +0300)
commit324336e7f6e45ef3d97a2e64be95b5e604b393d3
tree2823601e4dabb86ac9d4327aca6bfee0ba4fd361
parentd240b1fe15d373b37c5939db52835816d88f0aab
Lazily encode data, params, files

Previously, data, params, and files were encoded and stored in
Request.__init__, and subsequently put into service during
Request.send. The problem with this approach is that hooks and auth
callables need to be aware of the eager encoding, and if they touch the
originals, make sure to update the encoded versions.

A better approach is to only encode late in the sending process. This
way, hooks and auth callables can safely make changes without fear of
the old, encoded variant overriding it.
requests/models.py