我在这个答案中找到了要升级的代码:https://codereview.stackexchange.com/a/55472
Webb webb = Webb.create();
Response<String> response = webb
.post("http://www.example.com/service")
.body(new File("camera/myfile.jpg"))
.connectTimeout(10 * 1000)
.asString();
if (response.isSuccess()) {
String outcome = response.getBody();
// ...
} else {
System.out.println(response.getStatusCode());
System.out.println(response.getResponseMessage());
System.out.println(response.getErrorBody());
}
但是如何跟踪上传的进度?