import org.apache.http.entity.mime.MultipartEntityBuilder; //导入方法依赖的package包/类
/**
* Encodes multipart/form-data where the body content must be an instance of the {@link MultipartContent} class. Individual parts will be
* encoded using the encoders available to the {@link ChainedHttpConfig} object.
*
* @param config the chained configuration object
* @param ts the server adapter
*/
public static void multipart(final ChainedHttpConfig config, final ToServer ts) {
try {
final ChainedHttpConfig.ChainedRequest request = config.getChainedRequest();
final Object body = request.actualBody();
if (!(body instanceof MultipartContent)) {
throw new IllegalArgumentException("Multipart body content must be MultipartContent.");
}
final String contentType = request.actualCont