问题
The error as stated is: formatexception (formatexception: unexpected character (at character 1) json Is there a solution to this?
回答1:
Try this one bro
final response = await http.post("url", body{
'username': username,
'password': password,
},
header{
'accept':'*/*'
});
回答2:
As you can see in the Exception, you are getting HTML code instead of JSON in the response.body:
<!DOCTYPE html PUBLIC "~//W3C/DTD XHTML 1.0 Strict//EN" "http://www.w3.org...
The solution would be to receive a JSON or to try to parse the HTML
来源:https://stackoverflow.com/questions/58264028/formatexception-formatexception-unexpected-character-at-character-1-json