Comments (4)
@sweet2o09 @ljackChen001 已更新1.1.1版支持POST请求
setPostData(@NonNull byte[] data);
setPostData(@NonNull String data);
例
UpdateManager.create(this).setUrl(mCheckUrl).setPostData("param=abc¶m2=xyz").check();
from update.
呃,暂时post只能重写IUpdateChecker
参考:
UpdateManager.create(this).setUrl(mCheckUrl).setChecker(new IUpdateChecker() {
@Override
public void check(ICheckAgent agent, String url) {
HttpURLConnection connection = null;
try {
connection = (HttpURLConnection) new URL(url).openConnection();
connection.setRequestProperty("Accept", "application/json");
connection.connect();
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
agent.setInfo(UpdateUtil.readString(connection.getInputStream()));
} else {
agent.setError(new UpdateError(UpdateError.CHECK_HTTP_STATUS, "" + connection.getResponseCode()));
}
} catch (IOException e) {
e.printStackTrace();
agent.setError(new UpdateError(UpdateError.CHECK_NETWORK_IO));
} finally {
if (connection != null) {
connection.disconnect();
}
}
}
}).check();
from update.
你解决了嘛?用后台是post+token请求 不知道咋整了
from update.
恩,这样就更灵活了,我可以用自己的网络框架请求数据,然后把数据传递给你的这个库,实现下载功能...谢谢
from update.
Related Issues (20)
- 8.0没法用了 HOT 1
- mContext.getExternalFilesDir("").getParentFile()报NullPointerException HOT 1
- 关于URL为NULL的bug
- NotificationCompat 已经从 v7 移动到 v4 了,使用这个项目可能导致 Class Not Found 异常
- 按钮颜色怎么改 HOT 1
- 查询服务端更新版本号的json格式是怎样的 HOT 1
- 怎么支持https的下载链接?
- 请教一下大神MD5如何获取?
- 请教一下大神 渠道sChannel是什么?
- 3010~~MD5值没有问题,就是一直报3010!
- hasUpdate 判断 不科学
- 断网后怎么继续下载呢
- 有适配8.0的手机吗 HOT 4
- maxSdkVersion
- 如何显示访问网络加载进度条
- 历史安装包无法删除
- 安装APK报错 HOT 1
- 作者现在停止更新迭代了吗?
- Update over the air
- 新包哈希值 问题 HOT 1
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 update.