我正在尝试通过在线网站转换许多 doc 文件,使用 HttpClient 来模拟 Http 请求
URI uri = new URI("http://www.docx2doc.com/convert/convert-file");
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(uri);
MultipartEntity reqEntity = new MultipartEntity(
HttpMultipartMode.BROWSER_COMPATIBLE);
reqEntity.addPart("email",new StringBody(""));
reqEntity.addPart("input_type",new StringBody("doc"));
reqEntity.addPart("output_type",new StringBody("html"));
reqEntity.addPart("script",new StringBody("converters"));
FileBody bin = new FileBody(
new File("mydoc.docx"));
reqEntity.addPart("input_file", bin );
httppost.setEntity(reqEntity);`
帖子中的所有参数(电子邮件、输出类型...)都被服务器接受,但文件不接受...
我该如何处理?
谢谢你。