use of com.lidroid.xutils.http.client.entity.UploadEntity in project xUtils by wyouflf.
the class HttpRequest method setRequestParams.
public void setRequestParams(RequestParams param, RequestCallBackHandler callBackHandler) {
if (param != null) {
if (uriCharset == null) {
uriCharset = Charset.forName(param.getCharset());
}
List<RequestParams.HeaderItem> headerItems = param.getHeaders();
if (headerItems != null) {
for (RequestParams.HeaderItem headerItem : headerItems) {
if (headerItem.overwrite) {
this.setHeader(headerItem.header);
} else {
this.addHeader(headerItem.header);
}
}
}
this.addQueryStringParams(param.getQueryStringParams());
HttpEntity entity = param.getEntity();
if (entity != null) {
if (entity instanceof UploadEntity) {
((UploadEntity) entity).setCallBackHandler(callBackHandler);
}
this.setEntity(entity);
}
}
}
Aggregations