Skip to content

Commit

Permalink
修改bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ansen666 committed Nov 15, 2019
1 parent 8e5fe83 commit 43006cf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public <T> void get(final Class<T> clazz,final String url,Header[] header,final

private Call getBuilder(String url, Header[] header, HttpResponseHandler responseCallback) {
url=Util.getMosaicParameter(url,httpConfig.getCommonField());//拼接公共参数
// Log.i("ansen","访问的url"+url);
Request.Builder builder = new Request.Builder();
builder.url(url);
builder.get();
Expand Down Expand Up @@ -169,6 +170,7 @@ public <T> T postSync(Class<T> clazz, String url, List<NameValuePair> form,Heade
if (checkAgent()) {
return null;
}
// Log.i("ansen","url:"+url);
Request.Builder builder=getRequestBuild(url,form);
byte[] bytes = execute(builder,header);
try {
Expand Down Expand Up @@ -213,7 +215,11 @@ private Request.Builder getRequestBuild(String url,List<NameValuePair> form){
form.addAll(httpConfig.getCommonField());//添加公共字段
FormBody.Builder formBuilder = new FormBody.Builder();
for (NameValuePair item : form) {
formBuilder.add(item.getName(), item.getValue());
if(TextUtils.isEmpty(item.getValue())){
printLog("字段:"+item.getName()+"的值为null");
continue;
}
formBuilder.add(item.getName(),item.getValue());
}
RequestBody requestBody = formBuilder.build();
Request.Builder builder = new Request.Builder();
Expand Down

0 comments on commit 43006cf

Please sign in to comment.