谁有调用过第三方的接口经验的 来看看?
http://trac.meyoung.cn/Trac/wiki/public/mefp#%E7%A4%BA%E4%BE%8B%E7%A8%8B%E5%BA%8F
谁给看看这个接口 怎么调用啊
我有测试用的帐号和key
QQ:
107566186
[解决办法]
public static String getResponseData(String url) throws Exception{
URL dataUrl = null;
String data = null;
try {
dataUrl = new URL(url);
} catch (MalformedURLException e1) {
e1.printStackTrace();
}
HttpURLConnection con = null;
try {
con = (HttpURLConnection) dataUrl.openConnection();
} catch (IOException e) {
e.printStackTrace();
}
con.setRequestMethod("GET");
con.setRequestProperty("Proxy-Connection", "Keep-Alive");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("Charset", "utf-8");
con.setDoOutput(true);
con.setDoInput(true);
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(),"utf-8"));
String line = "";
String result = "";
while(null != (line=br.readLine())){
result += line;
}
return result;
}