Calling an external api for user authentication and build a graphql client
Try to use request, with jsonEncode:
final response = await http.post(
url,
headers: {
"Content-type": 'application/x-www-form-urlencoded',
"accept": "application/json",
},
body: jsonEncode({
"username": username,
"password": password,
"plataforma": plataforma,
}),
);
and, without jsonEncode
final response = await http.post(
url,
headers: {
'pragma': 'no-cache',
'cache-control': 'no-cache',
'cookie': 'signInPanel..signInForm..$username'
},
body: ({
"username": username,
"password": password,
"plataforma": plataforma,
}),
);
in both options, triggerd error
Apreciate some help.
Top comments (0)