Questions tagged [flutter-http]

241 questions
91
votes
1 answer

SocketException: Connection failed (OS Error: Operation not permitted, errno = 1) with flutter app on macOS

I have following code in my Flutter app where MyDataLoader is a widget which starts up from main.dart Code: import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; class MyDataLoader extends StatefulWidget { @override …
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
39
votes
2 answers

How to enable Flutter internet permission for macos desktop app?

I am trying to develop Flutter app which will run also on destkop. This app is using http package: import 'package:http/http.dart' When I am trying to perform http request I am getting this exception: SocketException: Connection failed (OS Error:…
K.Os
  • 5,123
  • 8
  • 40
  • 95
20
votes
6 answers

Flutter: How to increase onSendProgress calls for a fluid progress bar animation while uploading files?

I have the following code to upload a file. var client = new dio.Dio(); await client.put( url, data: formData, options: dio.Options( headers: headers, ), onSendProgress: (int sent, int total) { final progress = sent / total; …
Tom Aalbers
  • 4,574
  • 5
  • 29
  • 51
14
votes
3 answers

Flutter: How to Refresh token when token expires during http call?

I am new to flutter and I am using http package for network call. I want to refresh token and call the request again if the response code of the request 200. How can I acheive this using http package? I heard about dio package but it is complicated…
techno
  • 141
  • 1
  • 1
  • 3
9
votes
1 answer

HTTP3 Client for flutter

Is There a HTTP3 client for dart? There is Flupke in Java, Aioqic in python but I didn't find one for dart as well as flutter
8
votes
4 answers

Upload Image/File to Strapi (Flutter Web)

I'm trying to upload an image to Strapi through Flutter Web. I'm aware (from this link) that I need to use FormData to do so. I've researched on many ways to do this and I stumble across Dio and of course Http. Both solutions gave me…
7
votes
1 answer

Why am I getting a ChromeProxyService error with Flutter Web and Chrome

I'm using Flutter version 3.3.8 and Google Chrome version 107.0.5304.110. I send an http request, and this is the error that I get: ChromeProxyService: Failed to evaluate expression 'xhr': InternalError: Expression evaluation in async frames is not…
7
votes
2 answers

how can i parse html in flutter?

I am using Flutter and want to parse HTML using parser.dart
Now
19.8 (23℃)
james
  • 235
  • 2
  • 5
  • 11
7
votes
1 answer

How to adjust download buffer size on flutter http, dio or flutter_downloader?

I want to download a large file that is amount of about 300MB. It was a lot slower than I thought, and when I looked at the log, I saw that it was fetching bytes with a size of about 8KB. I haven't found a way to resize the download buffer even if…
rollrat
  • 151
  • 13
6
votes
1 answer

In Android 12+, the REST API calls are very slow in flutter, In WiFi that takes 10 seconds whereas in mobile data it is less than a second

I am facing an issue with Flutter Android 12+ version. App-consuming REST API calls using the Flutter http plugin (Version: 0.13.5). All API calls are HTTPS service calls with the domain name. API calls take 10+ seconds to provide the response…
John_S
  • 532
  • 4
  • 10
5
votes
1 answer

how to solve error Handshake error in client UNSUPPORTED_PROTOCOL(handshake_client.cc:697)?

The problem occurs only when I update the version of flutter. The version before: 2.5.3 The current version: 2.10.3
5
votes
1 answer

Flutter upload file through rest api endpoint

I have a flutter app that interacts with a server through a REST api where it can fetch and display information. It can also send text information to the server. I want to add functionality of sending pdf files and images to the server but I dont…
Kevnlan
  • 487
  • 2
  • 10
  • 31
4
votes
1 answer

Cancel file download with http response in Flutter

I need to cancel download process while file downloading. final http.Response responseData = await http.get("URL_HEAR"); How can I stop/abort current running download file. I am newbie in flutter. Can anyone help me out this.
Jay Nirmal
  • 380
  • 2
  • 10
4
votes
1 answer

Get Json response when Webview redirect to another page in Flutter

flutter_webview_plugin^0.3.11 I am building a payment gateway and in 3d secure mode I need to use Webview. Launch Webview with a response in type of html string. return Scaffold( body: WebviewScaffold( withJavascript: true, key:…
Muhtar
  • 1,506
  • 1
  • 8
  • 33
4
votes
2 answers

Flutter http Package POST API call return 302 instead of 200, post is success in DB

Hi when I make an API post request via Postman getting the correct status code as 200 but make the same api call with flutter/http package (v0.12.0+4) or DIO (v3.0.9) package I'm getting status code as 302, but the post was successful and the data…
Sam
  • 6,215
  • 9
  • 71
  • 90
1
2 3
16 17