Skip to content

Commit 6afdfdc

Browse files
DoldrumsLinusU
andauthored
Fix HTTP POST call in example code (LinusU#148)
* Update README.md as breaking changes in http dart packet please consider to use * Update README.md Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
1 parent d9fe83f commit 6afdfdc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ final result = await FlutterWebAuth.authenticate(url: url.toString(), callbackUr
5656
// Extract code from resulting url
5757
final code = Uri.parse(result).queryParameters['code'];
5858
59+
// Construct an Uri to Google's oauth2 endpoint
60+
final url = Uri.https('www.googleapis.com', 'oauth2/v4/token');
61+
5962
// Use this code to get an access token
60-
final response = await http.post('https://www.googleapis.com/oauth2/v4/token', body: {
63+
final response = await http.post(url, body: {
6164
'client_id': googleClientId,
6265
'redirect_uri': '$callbackUrlScheme:/',
6366
'grant_type': 'authorization_code',

0 commit comments

Comments
 (0)