From dd89ac38a9edae137571f882067a5a8b1594c2d3 Mon Sep 17 00:00:00 2001 From: Lx Yu Date: Fri, 20 Dec 2013 15:15:26 +0800 Subject: [PATCH] fix for post data type error in py3. --- flask_oauthlib/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flask_oauthlib/client.py b/flask_oauthlib/client.py index 3aea1c51..4c3c4db3 100644 --- a/flask_oauthlib/client.py +++ b/flask_oauthlib/client.py @@ -572,6 +572,8 @@ def handle_oauth2_response(self): remote_args.update(self.access_token_params) if self.access_token_method == 'POST': body = client.prepare_request_body(**remote_args) + if PY3: + body = body.encode('utf-8') resp, content = self.http_request( self.expand_url(self.access_token_url), data=body,