fix cell style

This commit is contained in:
Looly
2019-08-21 20:20:19 +08:00
parent 9ed6412bac
commit def6b802f3
7 changed files with 228 additions and 25 deletions

View File

@@ -134,6 +134,25 @@ public abstract class HttpBase<T> {
return header(name, value, true);
}
/**
* 设置请求头
*
* @param headers 请求头
* @param isOverride 是否覆盖已有头信息
* @return this
* @since 4.6.3
*/
public T headerMap(Map<String, String> headers, boolean isOverride) {
if(CollectionUtil.isEmpty(headers)) {
return (T)this;
}
for (Entry<String, String> entry : headers.entrySet()) {
this.header(entry.getKey(), StrUtil.nullToEmpty(entry.getValue()), isOverride);
}
return (T)this;
}
/**
* 设置请求头<br>
* 不覆盖原有请求头
@@ -146,8 +165,7 @@ public abstract class HttpBase<T> {
}
/**
* 设置请求头<br>
* 不覆盖原有请求头
* 设置请求头
*
* @param headers 请求头
* @param isOverride 是否覆盖已有头信息