修复重构loader后,http上传失败的问题

This commit is contained in:
laoyuyu
2020-01-08 19:42:16 +08:00
parent 432ae1c145
commit 7c4012c021
28 changed files with 255 additions and 106 deletions

View File

@@ -35,6 +35,7 @@ public class HttpOption extends BaseOption {
private Proxy proxy;
private boolean useServerFileName = false;
private IHttpFileLenAdapter fileLenAdapter;
private String attachment;
public HttpOption() {
super();
@@ -84,6 +85,19 @@ public class HttpOption extends BaseOption {
return this;
}
/**
* 设置文件上传需要的key
*
* @param attachment 如果为空,默认为"file"
*/
public HttpOption setAttachment(String attachment) {
if (TextUtils.isEmpty(attachment)) {
attachment = "file";
}
this.attachment = attachment;
return this;
}
/**
* 给url请求添加Header数据
* 如果新的header数据和数据保存的不一致则更新数据库中对应的header数据