java后台模拟post接口上传

来源:互联网 发布:怎么安装ubuntu系统 编辑:程序博客网 时间:2024/05/16 05:53

简介:Java后台模拟post请求,发送参数以及上传文件等方式,适用有些公众API接口的调用.

需要知道服务器接口地址及本地文件地址,如:String filepath = "F:\\2.png";  String urlStr = "http://localhost:8080/wxchar_menu/upload";  

参考1:http://blog.csdn.net/u014201191/article/details/46597563

参考2:http://www.jb51.net/article/74292.htm