问题
I'm creating an app using flutter, in this I'm creating a post request then reading the response as string (later to convert into json).
Future<String> post([String url = "https://example.com/get-new"]) async {
return await http.post(Uri.encodeFull(url),
headers: {"Accept": "application/json"}).then((http.Response response) {
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode > 400) {
throw new Exception("Error while fetching data");
}
return response.body;
});
}
post().then((val){
print(val);
});
It's working fine and getting the response, but as my question says, response is limited to 1023 characters. I checked it with postman and found the response is coming properly as needed.
It would be great if anyone would help me out to solve this issue.
Thanks in advance
来源:https://stackoverflow.com/questions/55361422/flutter-http-post-response-is-limiting-to-1023-characters