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)
- 为什么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 41
- 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 HOT 1
- 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 HOT 5
- when using "handler.reject(error);" in onError of interceptors, I cannot DioException in .catchError(), but find it in .then(). HOT 1
- Dio cannot connect to the Internet after VPN is enabled on iOS devices HOT 1
- Response has unsupport header throw exception: Failed to parse header value.message HOT 6
- Network calls gets stuck on iOS 16.6+ and 17 HOT 1
- Dio Throws Exception on DELETE Request with 204 Response HOT 4
- BrowserHttpClientAdapter() error in web. HOT 6
- Duplicate the base url HOT 4
- Use dart_apitool to detect breaking changes
- Keep `DioException.toString` clean !!! HOT 5
- `no address assoiated with hostname` error in release build apk HOT 2
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.