Questions tagged [flutter-http]
241 questions
1
vote
2 answers
How to handle navigation while an HTTP request is made in Flutter?
In my Flutter App, there are 2 screens called "home screen" and "data screen". In data screen I am making a GET Http request to a server and after if request is successful, I need to change some state using riverpod providers.
Data screen http…

Emre Turan
- 83
- 1
- 8
1
vote
0 answers
Flutter http: No route to host when trying to send a request to localhost:5000
I am trying to use a Flutter app running on a device (and debugging via Android Studio) to make a simple GET request to my localhost:5000. The response should be the result of a stored procedure being run on SQL Server, shown…

TheMortiestMorty
- 421
- 2
- 4
- 12
1
vote
1 answer
Connection reset by peer - Flutter http package
Infrequently I get Connection reset by peer error. As a result the the application continues to see circular progress bar and remains stuck there.
I am using http package "http: ^0.13.5".
Is there a way to handle this…

Saad Bashir
- 4,341
- 8
- 30
- 60
1
vote
1 answer
Can't Catching two awaits in dart/fluttter http module
Please help I have been searching for hours and found no solution.
I want to get data from two APIs so I call the two methods that return future and then await for their return value so that I don't wait if one takes too long.
When I try to handle…

Ahmed Gado
- 26
- 1
1
vote
1 answer
How to deal with HTTP connection timed out crashes in Flutter
So I have a method that uses the Flutter HTTP library and is responsible for calling HTTP requests to the server with code like this:
Future
- > fetchData() async {
try {
var url = Uri.parse('${baseUrlParse}myapipath');
var…

Muhammad Faisal
- 734
- 10
- 24
1
vote
0 answers
can't connect django rest api with flutter and it always show connect refused
async{
try {
var url = Uri.parse("http://127.0.0.1:8000/todoget/");
var response = await http.get(url,);
print(response.statusCode.toString());
}
catch (e)
{
print(e.toString());
…

Abhinav singh
- 11
- 1
1
vote
0 answers
Flutter http request works on Android but not Chrome or MacOS
This is the code that I am running:
var response = await http.get(
Uri.parse(
'https://arkiteki.co/api/v1/questions',
),
);
Results:
Android: Works
Chrome: Error: XMLHttpRequest error.
MacOS: connection failed
Same code,…

Joel Castro
- 485
- 6
- 20
1
vote
1 answer
How to cancel the then function in a future if catcherror is executed in flutter app
I'm trying to login in users using a third party api. But the problem is whenever an error occurs and the catch error is executed the "then" function that holds the navigation to the HomeScreen also is executed. Please is there a way to login user…

Ariyo
- 49
- 4
1
vote
1 answer
flutter multipart force content type
I try send image as Multipart file and add to header mime type: image/jpeg
But if I look into http request, I see that contentType is: Multipart/form-data;boundary.... not image/jpeg
This is screenshot from DartDevTools with information about…

sosnus
- 968
- 10
- 28
1
vote
0 answers
How to receive server-sent events (SSE) in Flutter Web?
I have tried several different SSE-plugins to receive server-sent events in a Flutter Web app, and all of them can connect but I don't receive any events in Flutter. However, if I open DevTools in Chrome and go to Network -> EventStream, I see the…

Magnus
- 17,157
- 19
- 104
- 189
1
vote
1 answer
What are the default headers used by http package?
What headers does Dart's http package use by default when POST or GET requests made from a Flutter application? Does using a Client make difference?

Stewie Griffin
- 4,690
- 23
- 42
1
vote
2 answers
How do I extract data from this http response?
I'm trying to build a "message board" in my app and these field_value are the message fields that I am trying to extract and display.
How do I extract this specific field field_value? There are 6 Users currently in the status S030 - Approved", from…

JoshuaaMarkkNairr
- 41
- 2
1
vote
3 answers
How to convert an Image instance to File instance in Flutter?
I am using VideoThumbanil class to fetch an Uint8List image of a video like this:
final uint8List = await VideoThumbnail.thumbnailData(video: videoFile.path,);
After doing so, i am converting the Uint8LIST to an Image using the following…

Abdul Ahad Akram
- 455
- 3
- 12
1
vote
2 answers
How to pass an image as parameter to a key in a post request Flutter?
The request body is a form-data. The request body has a key, image that expects a file (image file here). This is what I've done so far:
final response = await http.MultipartRequest(
'POST', Uri.parse(Constant.baseUrl + 'api/patients'))
…

Shourya Shikhar
- 1,342
- 1
- 11
- 29
1
vote
3 answers
Flutter type '_InternalLinkedHashMap' is not a subtype of type 'List'
I'm a Flutter language learner, new to this world,
I have a json like:
{
"USDBRL":
{
"id": "...",
"name": "...",...
}
}
My Dolar Model:
class Dolar {
String param1;
String param2;
// Constructor
Dolar({
required…

Gabriel Carvalho
- 23
- 1
- 7