-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于加密post请求查询新版本问题 #24
Comments
呃,暂时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(); |
你解决了嘛?用后台是post+token请求 不知道咋整了 |
@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(); |
恩,这样就更灵活了,我可以用自己的网络框架请求数据,然后把数据传递给你的这个库,实现下载功能...谢谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你好,看了很多个自升级库,感觉你的这个是比较好的,不过有个问题想问下
我这边的App,查询版本更新是使用post方式向服务器传递当前版本号等参数,并且加密过后传递给服务器,服务器会根据我传递的版本号,告知我是否有新版本
但是如果我要使用你的这个库,不知道如何处理这个请求,是否可以把请求回来的参数直接传递到你的这个update库中,剩下的下载,通知栏,安装等操作由你的库来控制?
The text was updated successfully, but these errors were encountered: