Comments (11)
@nickzhuo 不能用localhost, localhost代表的是手机的地址,你要访问电脑的话要用ip
from dio.
8080端口的服务存在吗?
from dio.
hi,我想请问下,我起本地服务,host:http://localhost:9031。一发请求就提示“DioError [DioErrorType.DEFAULT]: SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 36632”
请问知道原因吗 ?
from dio.
你好, jairwen ,我遇到和你一样的问题,我通过读取源码发现,Dio的请求返回的类型默认时json类型(这样就会有一个TransFormer转换过程,转换过程需要mimeType的,源码是这样的
if (options.responseType == ResponseType.JSON &&
response.headers.contentType.mimeType == ContentType.JSON.mimeType) {
return JSON.decode(responseBody);
}
```),而当请求为get的时候,你可能没有设置options为new Options(responseType: ResponseType.PLAIN)。
from dio.
@xgbxmgg 这块逻辑github源码已更新,但还没有发布到pub上
from dio.
已修复,请升级dio到最新版本
from dio.
@zll33 你的问题解决了吗?我也遇到了同样的问题,如果解决了,可否告知一下是什么原因和解决方法,谢谢
from dio.
@zll33 你的问题解决了吗?在我的环境目前还在。我的版本1.0.6。
from dio.
@wendux 没有修复这个在localhost的问题啊!
from dio.
@wendux 明白了,学到了!
from dio.
发现并没有修复这个问题呢,4.0.3版本
var dio = Dio();
init({ String? baseUrl }) {
dio.options.baseUrl = 'http://127.0.0.1:8099';
dio.options.connectTimeout = 5000; //5s
dio.options.receiveTimeout = 3000;
CookieJar cookieJar = CookieJar();
dio.interceptors.add(CookieManager(cookieJar));
}
dio.get('/test');会报错:SocketException: OS Error: Connection refused, errno = 111, address = 127.0.0.1, port = 52816
from dio.
Related Issues (20)
- Can we extend a DNS class to facilitate implementing DNS Over HTTPS HOT 1
- Failed host lookup error at every request after disconnecting and reconnecting to internet. HOT 3
- 302没有带上cookie HOT 1
- Can't send multipart request, file inside json object HOT 1
- When CancelToken.cancel cancels the request and the request times out, StateError is thrown HOT 1
- error: ../../../.pub-cache/hosted/pub.dev/dio-5.4.3/lib/src/form_data.dart:175:54: Error: The argument type 'List<int>' can't be assigned to the parameter type 'Uint8List'. HOT 2
- Running Gradle task 'assembleProfile'.. ../../../.pub-cache/hosted/pub.dev/dio-5.4.3/lib/src/ form_data.dart:175:54: Error: The argument type 'List <int>' can't be assigned to the parameter type 'Uint8list'. HOT 1
- Improve Exception Detailing for Dio HOT 1
- Improve Exception Detailing for Dio Package HOT 1
- SocketException: Connection reset by peer (OS Error: Connection reset by peer, errno = 104), address = XXXX, port = 49440 HOT 2
- Docs for merging between `Options` and `BaseOptions` are not clear HOT 12
- Cookie manager path match error HOT 1
- When using Dio in a web environment, there needs to be a way to disable Dio’s automatic cookie setting HOT 8
- Prompt for not simple requests on Web HOT 2
- DioException response.data is null HOT 1
- [native_dio_adapter] Windows build breaks when adding package HOT 1
- DioException (DioException [connection error]: The connection errored: Connection reset by peer This indicates an error which most likely cannot be solved by the library. HOT 3
- Add privacy manifest file for iOS HOT 1
- incorrect formatting when parsing `multipart` form data using `FormData.fromMap()` causes `NullReferenceException` in .NET backend HOT 2
- I can't return my own errors class in onError interceptor
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.