【发布时间】:2019-05-14 10:19:43
【问题描述】:
我使用 Retrofit 2 和 POST Rest 调用将一些数据发送到后端。我的休息界面是这样的:
void postSpecialData(String base64, Callback callback);
而我的回调是 Retrofit 接口:
void onResponse(Call<T> call, Response<T> response);
void onFailure(Call<T> call, Throwable t);
我终于打电话了:
getRestCommunicator().postSpecialData(encryptedBase64, new Callback() {
@Override
public void onResponse(Call call, Response response) {
toast("Response code " + response.code());
}
@Override
public void onFailure(Call call, Throwable t) {
toast("Failure REST CALL");
}
});
encryptedBase64 变量既不是文件也不是存储在某处。 例如,如何获取上传进度以使其在进度条上可见?
【问题讨论】:
标签: android rest http-post retrofit2 okhttp3