kennethreitz/requests — pull request #451 by maraujop (2012-02-22 15:19:15+00:00)
Title: Recalculating body and content type after hooks

This a patch for issue #GH-445

Perfomance improvements are left to be done. For example, only recalculating when `request.data` or `request.files` have changed.

* File pointers are reset to position 0 to re-read files, when `_encode_body` is called several times.
* _enc_data is recalculated using data which might have changed.