buffer.append("Content-Disposition: form-data; name=\"").append(name).append('"').append(CRLF);
buffer.append(CRLF);
buffer.append(string);
}
else if (value instanceof Uploadable) {
Uploadable uploadable = (Uploadable) value;
String fileName = uploadable.getFileName();
if (fileName == null) {
fileName = name;
}
buffer.append("Content-Disposition: form-data; name=\"").append(name);
buffer.append("\"; filename=\"").append(fileName).append('"').append(CRLF);
String mimeType = uploadable.getMimeType();
if (mimeType == null) {
mimeType = MimeTypes.getMimeType(FileNameUtil.getExtension(fileName));
}
buffer.append(HEADER_CONTENT_TYPE).append(": ").append(mimeType).append(CRLF);