Why auth must be prepared last
authorIb Lundgren <ib.lundgren@gmail.com>
Wed, 19 Dec 2012 20:30:11 +0000 (21:30 +0100)
committerIb Lundgren <ib.lundgren@gmail.com>
Wed, 19 Dec 2012 20:30:11 +0000 (21:30 +0100)
requests/models.py

index a7009eb..59f8ad4 100644 (file)
@@ -195,6 +195,8 @@ class Request(RequestHooksMixin):
         p.prepare_headers(self.headers)
         p.prepare_cookies(self.cookies)
         p.prepare_body(self.data, self.files)
+        # Note that prepare_auth most be last to enable authentication schemes
+        # such as OAuth to work on a fully prepared request.
         p.prepare_auth(self.auth)
 
         return p