|
@@ -16,6 +16,7 @@ import org.apache.http.entity.ContentType;
|
|
import org.apache.http.entity.StringEntity;
|
|
import org.apache.http.entity.StringEntity;
|
|
import org.apache.http.entity.mime.HttpMultipartMode;
|
|
import org.apache.http.entity.mime.HttpMultipartMode;
|
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
|
|
|
+import org.apache.http.entity.mime.content.StringBody;
|
|
import org.apache.http.impl.client.HttpClients;
|
|
import org.apache.http.impl.client.HttpClients;
|
|
import org.apache.http.message.BasicHeader;
|
|
import org.apache.http.message.BasicHeader;
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
@@ -228,7 +229,9 @@ public class HttpUtil {
|
|
File file = new File((String) params.get(key));
|
|
File file = new File((String) params.get(key));
|
|
entityBuilder.addBinaryBody(key, file, ContentType.DEFAULT_BINARY, file.getName());
|
|
entityBuilder.addBinaryBody(key, file, ContentType.DEFAULT_BINARY, file.getName());
|
|
} else {
|
|
} else {
|
|
- entityBuilder.addTextBody(key, String.valueOf(params.get(key)), contentType);
|
|
|
|
|
|
+// entityBuilder.addTextBody(key, String.valueOf(params.get(key)), contentType);
|
|
|
|
+ StringBody stringBody = new StringBody(String.valueOf(params.get(key)), contentType);
|
|
|
|
+ entityBuilder.addPart(key, stringBody);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|