稳定、快速、免费的 API 接口服务
共收录了
14 个接口
随机获取网易云评论
接口地址: https://api.zdck8.com/Api/php/wangyiyunpinglun
返回格式: JSON
请求方式: GET
请求示例: https://api.zdck8.com/Api/php/wangyiyunpinglun?
请求参数说明:
名称 | 必填 | 说明 |
---|
返回参数说明:
名称 | 类型 | 说明 |
---|
返回示例:
{"success":true,"data":{"id":1334295185,"name":"u5199u7ed9u9ec4u6dee","auther":"u89e3u5fe7u90b5u5e05","picUrl":"https://p1.music.126.net/CG8hLG4To_TZum0rIGk7WA==/109951163764772334.jpg","mp3url":"https://m701.music.126.net/20231230031840/0f8e8e819ee23c964ff251654a809625/jdymusic/obj/wo3DlMOGwrbDjj7DisKw/28481678683/d27f/aa02/e274/1021c3fea88f73022297aacef9d29190.mp3","avatarUrl":"https://p1.music.126.net/7bCugutJVpK2NJtldd6fxw==/109951164836920156.jpg","content":"u522bu518du95eeu6211u9ec4u6deeu662fu8c01u3002u9ec4u6deeu53efu80fdu662fu4e00u4e2au4ebauff0cu4e5fu53efu80fdu662fu4e00u4e2au5730u65b9uff0cu4e5fu53efu80fdu662fu5fc3u4e2du7684u67d0u79cdu5bc4u6258u3002u53efu7231u800cu4e0du53efu5f97uff0cu9057u61beu53c8u6216u8005u6000u5ff5u4e0bu7684u4f9du604bu3002u4ee5u60a3u5f97u60a3u5931u7684u68a6u4e3au98dfu7269uff0cu4ee5u53efu6709u53efu65e0u7684u4ebau505au98dfu5ba2uff0cu914du4e0au7275u80a0u6302u809au7684u9152u3002u522bu518du95eeu6211u9ec4u6deeu662fu8c01uff0cu662fu4f60u5fc3u4e2du6700u67d4u8f6fu7684u5730u65b9u3002u65e0u5173u4efbu4f55u5177u4f53u4ebau6216u7269u3002 u200bu200bu200b---u300au89e3u5fe7u90b5u5e05u300b"}}
错误码格式说明:
名称 | 类型 | 说明 |
---|
PHP代码示例:
$get="https://api.zdck8.com/Api/php/wangyiyunpinglun?"; $result=file_get_contents($get); if($result) { //请求成功 echo $result; }else{ //请求失败 }
$url='https://api.zdck8.com/Api/php/wangyiyunpinglun'; $data=array( ); $data=http_build_query($data); $option =array('http'=>array('method'=>'POST','content'=>$data)); $context=stream_context_create($option); $result=file_get_contents($url,false,$context); if($result) { //成功 echo $result; }else{ //失败 }
Java代码示例:
String httpurl = "https://api.zdck8.com/Api/php/wangyiyunpinglun?"; HttpURLConnection connection = null; InputStream is = null; BufferedReader br = null; String result = null; try { URL url = new URL(httpurl); connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setConnectTimeout(15000); connection.setReadTimeout(60000); connection.connect(); if (connection.getResponseCode() == 200) { is = connection.getInputStream(); br = new BufferedReader(new InputStreamReader(is, "UTF-8")); StringBuffer sbf = new StringBuffer(); String temp = null; while ((temp = br.readLine()) != null) { sbf.append(temp); } result = sbf.toString(); } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (null != br) { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } if (null != is) { try { is.close(); } catch (IOException e) { e.printStackTrace(); } } connection.disconnect(); } System.out.println(result);//返回内容
PrintWriter out = null; BufferedReader in = null; String result = ""; String param =""; String url ="https://api.zdck8.com/Api/php/wangyiyunpinglun?"; try { URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); conn.setRequestProperty("accept", "*/*"); conn.setRequestProperty("connection", "Keep-Alive"); conn.setRequestProperty("user-agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); conn.setDoOutput(true); conn.setDoInput(true); out = new PrintWriter(conn.getOutputStream()); out.print(param); out.flush(); in = new BufferedReader( new InputStreamReader(conn.getInputStream())); String line; while ((line = in.readLine()) != null) { result += line; } } catch (Exception e) { System.out.println("发送 POST 请求出现异常!"+e); e.printStackTrace(); } finally{ try{ if(out!=null){ out.close(); } if(in!=null){ in.close(); } } catch(IOException ex){ ex.printStackTrace(); } } System.out.println(result);//返回内容
JavaScript代码示例:
var url = "https://api.zdck8.com/Api/php/wangyiyunpinglun?" var xhrGet = new XMLHttpRequest(); xhrGet.open('GET',url, true); xhrGet.send(); xhrGet.onreadystatechange = function() { if (xhrGet.readyState == 4 && xhrGet.status == 200) { //成功 var result = xhrGet.responseText; console.log(result); } else { //失败 } }
var url ="https://api.zdck8.com/Api/php/wangyiyunpinglun"; var data = ""; var xhrPost = new XMLHttpRequest(); xhrPost.open('POST', url, true); xhrPost.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhrPost.send(data); xhrPost.onreadystatechange = function() { if (xhrPost.readyState == 4 && xhrPost.status == 200) { //成功 var result = xhrPost.responseText; console.log(result); } else { //失败 } }