Comments (5)
Ok, thanks for the tip.
I tried :
Options options= new Options(
responseType: ResponseType.STREAM
);
Dio dio = new Dio(options);
try {
Response response = await dio.download(
url, outputDirectory + filename, flush: true);
dio.interceptor.response.onError = (DioError e) {
print("error=" + e.message);
};
} on DioError catch (e) {
print("error "+e.message);
}
It does download the file, but is never returning from the download method.
from dio.
Why not use download
API directly ?
from dio.
could you print the response ?
from dio.
I don't believe there was any error, although that was a month ago. I have just used the standard dart mechanism instead.
from dio.
I'm sorry to reply late.
In my local, It works normally, May you need to update the dio to latest version, my test code as follows:
try {
Response response=await dio.download(url,
"./example/flutter.png",
// Listen the download progress.
onProgress: (received, total) {
print((received / total * 100).toStringAsFixed(0) + "%");
}
);
print("xxx");
} catch (e) {
print(e);
}
The xxx
displays in console.
Close first, and open again when there is a problem。
from dio.
Related Issues (20)
- post请求超时无反应 HOT 1
- Error Dio flutter web HOT 1
- upload file send timeout
- Header is out of order HOT 3
- `ResponseType.stream` is not working on web. HOT 1
- [🔔 Dio] sendTimeout cannot be used without a request body to send HOT 2
- `Transformer.isJsonMimeType` throws format exceptions without caught
- onError is not returning any error HOT 3
- Error when uploading image using MultipartFile.fromBytes in version 5.4.3+1 HOT 1
- 为什么dio的fromMap会将MultipartFile自动放入files字段中 HOT 1
- Error: The method 'debugLog' isn't defined for the class 'BrowserHttpClientAdapter'. HOT 1
- Version 5.5.0 brakes the web build HOT 1
- Is it now possible to use DIO / dio_web_adapter with Web/WASM? HOT 37
- Dio 5.5 broke compilation for WASM HOT 6
- ResponseType.stream returns responce all at once on Web HOT 1
- Date header not parsed correctly
- set proxy for BrowserHttpClientAdapter HOT 1
- Dio fetch can't catch error HOT 1
- Return the app to the desktop, then switch to Wi Fi in the system. After switching to Wi Fi, click on the desktop app icon to enter the app. At this point, there is an exception when sending network requests. This is highly likely to occur on Ios
- when using "handler.reject(error);" in onError of interceptors, I cannot DioException in .catchError(), but find it in .then().
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dio.