成语大全

返回一些列精心整理的成语


请求地址:http://api.xiaocongjisuan.com/life/idiom/get
返回格式:json/xml
请求方式:http/https; get/post
参数示例:appKey=yours&openId=yours&currentPage=1&pageSize=10
请求参数说明:
名称类型必填说明
appKeyString接口唯一标识,在用户后台->应用中心->我的接口查看
openIdString平台id,注册后系统自动生成,在用户后台->用户中心->账户信息查看
dTypeString接口数据返回类型,可选值:json、xml,默认值:json
currentPageInteger当前页数,默认第1页,取大于0的正整数
pageSizeInteger每一个页成语条数,默认10条/页,条数取[1,20]之间的正整数
返回结果说明:
名称类型说明
errorCodeInteger错误码,请参看错误码解释
errorString错误标识
errorMessageString错误提示
idiomString成语
pinyinString拼音
explanationString解释
derivationString来源
sampleString例句
json返回示例:
{
    "data": {
        "idioms": [
            {
                "idiom": "北道主人", 
                "pinyin": "běi  dào  zhǔ  rén", 
                "explanation": "北道上接待过客的主人。与“东道主人”同义。", 
                "derivation": "《后汉书·邓晨传》:“更始北都洛阳,以晨为常山太守。会王郎反,光武自蓟走信都,晨亦间行会于巨鹿下,自请从击邯郸。光武曰:‘伟卿(邓晨)以一从我,不如以一郡为我北道主人。’”", 
                "sample": null
            }, 
            {
                "idiom": "匕鬯不惊", 
                "pinyin": "bǐ chàng bù  jīng", 
                "explanation": "匕:古代的一种勺子;鬯:香酒;匕和鬯都是古代宗庙祭祀用物。形容军纪严明,所到之处,百姓安居,宗庙祭祀,照常进行。", 
                "derivation": "《周易·震》:“震惊百里,不丧匕鬯。”", 
                "sample": "赣、宁之乱,坐镇上游,~,指挥若定。(蔡东藩、许廑父《民国通俗演义》第三十六回)"
            }, 
            {
                "idiom": "鳏寡孤独", 
                "pinyin": "guān  guǎ  gū  dú", 
                "explanation": "泛指没有劳动力而又没有亲属供养的人。", 
                "derivation": "《孟子·梁惠王下》:“老而无妻曰鳏,老而无夫曰寡,老而无子曰独,幼而无父曰孤;此四者,天下之穷民而无告者。”", 
                "sample": null
            }, 
            {
                "idiom": "华屋秋墟", 
                "pinyin": "huá  wū  qiū  xū", 
                "explanation": "壮丽的建筑化为土丘。比喻兴亡盛衰的迅速。", 
                "derivation": "三国·魏·曹植《箜篌引》:“生在华屋处,零落归山丘。”", 
                "sample": "这个艳传,那个步韵,比对于~,生民涂炭之惨的大事情还起劲。(鲁迅《且介亭杂文·病后杂谈》)"
            }, 
            {
                "idiom": "山陬海噬", 
                "pinyin": "shān  zōu  hǎi  shì", 
                "explanation": "形容遥远偏僻的地方。", 
                "derivation": null, 
                "sample": null
            }, 
            {
                "idiom": "阿鼻地狱", 
                "pinyin": "ā  bí  dì  yù", 
                "explanation": "阿鼻:梵语的译音,意译为“无间”,即痛苦无有间断之意。常用来比喻黑暗的社会和严酷的牢狱。又比喻无法摆脱的极其痛苦的境地。", 
                "derivation": "语出《法华经·法师功德品》:“下至阿鼻地狱。”", 
                "sample": "但也有少数意志薄弱的……逐步上当,终至堕入~。 ★《上饶集中营·炼狱杂记》"
            }, 
            {
                "idiom": "阿狗阿猫", 
                "pinyin": "ā  gǒu  ā  māo", 
                "explanation": "旧时人们常用的小名。引申为任何轻贱的,不值得重视的人或著作。", 
                "derivation": "鲁迅《我们要批评家》:“然而新的批评家不开口,类似批评家之流便趁势一笔抹杀:‘阿狗阿猫’。”", 
                "sample": null
            }, 
            {
                "idiom": "阿姑阿翁", 
                "pinyin": "ā  gū  ā  wēng", 
                "explanation": "阿:名词的前缀。姑:丈夫的母亲。翁:丈夫的父亲。指公公婆婆。", 
                "derivation": "见:“阿家阿翁”。", 
                "sample": "既然如此,你我两个,便学个不痴不聋的~。 ★《儿女英雄传》二三回"
            }, 
            {
                "idiom": "阿家阿翁", 
                "pinyin": "ā  gū  ā  wēng", 
                "explanation": "阿:名词的前缀。家:通“姑”,丈夫的母亲。翁:丈夫的父亲。指公公婆婆。", 
                "derivation": "唐·赵璘《因话录》卷一:“郭暖尝与升平公主琴瑟不调。尚父拘暖,自诣朝童结罪。上召而慰之曰:‘谚云:不痴不聋,不作阿家阿翁。’”", 
                "sample": null
            }, 
            {
                "idiom": "阿娇金屋", 
                "pinyin": "ā  jiāo  jīn  wū", 
                "explanation": "阿娇:指汉武帝刘彻的姑母(长公主刘娇)的女儿。原指汉武帝刘彻要用金屋接纳阿娇为妇。这里泛指美丽高贵的女子。", 
                "derivation": "语出旧题汉·班固《汉武故事》:汉武帝幼时曾对姑母长公主说:“若得阿娇(姑母之女)作妇,当以金屋贮之。”", 
                "sample": "~原相配,太其玉镜宁无时? ★明·周履靖《锦笺记·诒婚》"
            }
        ]
    }, 
    "errorMessage": "成功", 
    "errorCode": 0, 
    "error": "success"
}
xml返回示例:
<Map> 
  <data> 
    <idioms> 
      <idiom>北道主人</idiom>  
      <pinyin>běi dào zhǔ rén</pinyin>  
      <explanation>北道上接待过客的主人。与“东道主人”同义。</explanation>  
      <derivation>《后汉书·邓晨传》:“更始北都洛阳,以晨为常山太守。会王郎反,光武自蓟走信都,晨亦间行会于巨鹿下,自请从击邯郸。光武曰:‘伟卿(邓晨)以一从我,不如以一郡为我北道主人。’”</derivation>  
      <sample/> 
    </idioms>  
    <idioms> 
      <idiom>匕鬯不惊</idiom>  
      <pinyin>bǐ chàng bù jīng</pinyin>  
      <explanation>匕:古代的一种勺子;鬯:香酒;匕和鬯都是古代宗庙祭祀用物。形容军纪严明,所到之处,百姓安居,宗庙祭祀,照常进行。</explanation>  
      <derivation>《周易·震》:“震惊百里,不丧匕鬯。”</derivation>  
      <sample>赣、宁之乱,坐镇上游,~,指挥若定。(蔡东藩、许廑父《民国通俗演义》第三十六回)</sample> 
    </idioms>  
    <idioms> 
      <idiom>鳏寡孤独</idiom>  
      <pinyin>guān guǎ gū dú</pinyin>  
      <explanation>泛指没有劳动力而又没有亲属供养的人。</explanation>  
      <derivation>《孟子·梁惠王下》:“老而无妻曰鳏,老而无夫曰寡,老而无子曰独,幼而无父曰孤;此四者,天下之穷民而无告者。”</derivation>  
      <sample/> 
    </idioms>  
    <idioms> 
      <idiom>华屋秋墟</idiom>  
      <pinyin>huá wū qiū xū</pinyin>  
      <explanation>壮丽的建筑化为土丘。比喻兴亡盛衰的迅速。</explanation>  
      <derivation>三国·魏·曹植《箜篌引》:“生在华屋处,零落归山丘。”</derivation>  
      <sample>这个艳传,那个步韵,比对于~,生民涂炭之惨的大事情还起劲。(鲁迅《且介亭杂文·病后杂谈》)</sample> 
    </idioms>  
    <idioms> 
      <idiom>山陬海噬</idiom>  
      <pinyin>shān zōu hǎi shì</pinyin>  
      <explanation>形容遥远偏僻的地方。</explanation>  
      <derivation/>  
      <sample/> 
    </idioms>  
    <idioms> 
      <idiom>阿鼻地狱</idiom>  
      <pinyin>ā bí dì yù</pinyin>  
      <explanation>阿鼻:梵语的译音,意译为“无间”,即痛苦无有间断之意。常用来比喻黑暗的社会和严酷的牢狱。又比喻无法摆脱的极其痛苦的境地。</explanation>  
      <derivation>语出《法华经·法师功德品》:“下至阿鼻地狱。”</derivation>  
      <sample>但也有少数意志薄弱的……逐步上当,终至堕入~。 ★《上饶集中营·炼狱杂记》</sample> 
    </idioms>  
    <idioms> 
      <idiom>阿狗阿猫</idiom>  
      <pinyin>ā gǒu ā māo</pinyin>  
      <explanation>旧时人们常用的小名。引申为任何轻贱的,不值得重视的人或著作。</explanation>  
      <derivation>鲁迅《我们要批评家》:“然而新的批评家不开口,类似批评家之流便趁势一笔抹杀:‘阿狗阿猫’。”</derivation>  
      <sample/> 
    </idioms>  
    <idioms> 
      <idiom>阿姑阿翁</idiom>  
      <pinyin>ā gū ā wēng</pinyin>  
      <explanation>阿:名词的前缀。姑:丈夫的母亲。翁:丈夫的父亲。指公公婆婆。</explanation>  
      <derivation>见:“阿家阿翁”。</derivation>  
      <sample>既然如此,你我两个,便学个不痴不聋的~。 ★《儿女英雄传》二三回</sample> 
    </idioms>  
    <idioms> 
      <idiom>阿家阿翁</idiom>  
      <pinyin>ā gū ā wēng</pinyin>  
      <explanation>阿:名词的前缀。家:通“姑”,丈夫的母亲。翁:丈夫的父亲。指公公婆婆。</explanation>  
      <derivation>唐·赵璘《因话录》卷一:“郭暖尝与升平公主琴瑟不调。尚父拘暖,自诣朝童结罪。上召而慰之曰:‘谚云:不痴不聋,不作阿家阿翁。’”</derivation>  
      <sample/> 
    </idioms>  
    <idioms> 
      <idiom>阿娇金屋</idiom>  
      <pinyin>ā jiāo jīn wū</pinyin>  
      <explanation>阿娇:指汉武帝刘彻的姑母(长公主刘娇)的女儿。原指汉武帝刘彻要用金屋接纳阿娇为妇。这里泛指美丽高贵的女子。</explanation>  
      <derivation>语出旧题汉·班固《汉武故事》:汉武帝幼时曾对姑母长公主说:“若得阿娇(姑母之女)作妇,当以金屋贮之。”</derivation>  
      <sample>~原相配,太其玉镜宁无时? ★明·周履靖《锦笺记·诒婚》</sample> 
    </idioms> 
  </data>  
  <errorMessage>成功</errorMessage>  
  <errorCode>0</errorCode>  
  <error>success</error> 
</Map>
全部评论
系统级错误码列表:
错误码 错误标识 错误提示
0 success 成功
1 fail 失败
2 pass 通过
3 data_allow 允许返回数据
10001 error_appkey 错误的appkey
10002 appkey_killed appkey被封杀
10003 api_exceed_max_limit 接口使用超过日最大限额,有可能威胁服务器安全
10004 api_exceed_limit 接口访问次数耗尽,请及时续费
10005 ip_illegal 该ip没有请求权限,请检查白名单设置
10006 ip_exceed_max_limit 当前ip请求超过限制
10007 ip_killed 当前ip被封杀
10008 error_openid 错误的openid
10009 openid_killed 该openid没有请求权限
10010 api_maintenance 接口维护
10011 api_closed 接口停用
10012 server_inner_error 服务器内部错误
10013 your_api_closed 该接口设置了关闭,请到用户后台查看
10014 your_api_not_bind_app 系统要求接口至少绑定一个应用,请到用户后台绑定
10015 do_not_authenticate 您的账户没有认证
10016 ip_bind_api_exceed 一个IP最多绑定2个相同接口
接口具体错误返回码列表:
错误码 错误标识 错误提示
20001 current_page_error 当前页参数错误
20002 page_size_error 每页返回个数参数错误或返回个数超过了20
20003 not_no_more 没有更多了
JAVA
package com.xiaocongjisuan.module.example;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

public class Application {
	
	 public static final String DEF_CHATSET = "UTF-8";
	 public static final int DEF_CONN_TIMEOUT = 30000;
	 public static final int DEF_READ_TIMEOUT = 30000;
	 public static String userAgent =  "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36";
	 
	 //配置您申请的appKey和openId
	 public static final String APP_KEY ="yours";
	 public static final String OPEN_ID ="yours";
	 
	 //将map型转为请求参数型
     public static String urlEncode(Map<String,Object> params) {
        
    	if(params==null){return "";};
    	 
    	StringBuilder sb = new StringBuilder();
        for (Map.Entry<String,Object> i : params.entrySet()) {
            try {
                sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue()+"","UTF-8")).append("&");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
        }
        String r=sb.toString();
        if(r.endsWith("&")){
        	r = r.substring(0,r.length()-1);
        }
        return r;
     }
     
     /**
     *
     * @param requestUrl 请求地址
     * @param params 请求参数
     * @param method 请求方法
     * @return 请求结果
     * @throws Exception
     */
     public static String requestContent(String requestUrl, Map<String,Object> params,String method) throws Exception {
        
    	HttpURLConnection conn = null;
        BufferedReader reader = null;
        String rs = null;
        try {

        	//组装请求链接
            StringBuffer sb = new StringBuffer();
            
            if(method!=null&&method.equalsIgnoreCase("get")){
            	requestUrl = requestUrl+"?"+urlEncode(params);
            }

            //默认get
            URL url = new URL(requestUrl);
            conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            
            if(method!=null&&method.equalsIgnoreCase("post")){
            	 conn.setRequestMethod("POST");
                 conn.setDoOutput(true);
                 conn.setDoInput(true);
            }

            //参数配置
            conn.setRequestProperty("User-agent", userAgent);
            conn.setUseCaches(false);
            conn.setConnectTimeout(DEF_CONN_TIMEOUT);
            conn.setReadTimeout(DEF_READ_TIMEOUT);
            conn.setInstanceFollowRedirects(false);
            conn.connect();
            
            if (params!= null && method.equalsIgnoreCase("post")) {
                try {
                    DataOutputStream out = new DataOutputStream(conn.getOutputStream());
                    out.writeBytes(urlEncode(params));
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            
            //读取数据
            InputStream is = conn.getInputStream();
            reader = new BufferedReader(new InputStreamReader(is, DEF_CHATSET));
            String strRead = null;
            while ((strRead = reader.readLine()) != null) {
                sb.append(strRead);
            }
            rs = sb.toString();
            
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (reader != null) {
                reader.close();
            }
            if (conn != null) {
                conn.disconnect();
            }
        }
        return rs;
    }
	
	
	public static void main(String[] args) throws Exception{
		
		String domain="http://api.xiaocongjisuan.com/";
		String servlet="life/idiom/get";
		String method="get";
		
		String requestUrl=domain+servlet;
		Map<String,Object> params=new HashMap<String,Object>();
		params.put("appKey",APP_KEY);
		params.put("openId",OPEN_ID);

		//变动部分
		params.put("currentPage",1);
		params.put("pageSize",10);
		
		
		String result=requestContent(requestUrl,params,method);
		System.out.println(result);
	}
}
PYTHON
# -*- coding: utf-8 -*-
# flake8: noqa
__author__ = 'wukong'

import urllib
from urllib import urlencode

#配置您申请的appKey和openId
app_key="***"
open_id="***"

"""
request_url 请求地址
params 请求参数
method 请求方法

"""
def request_content(request_url,params,method):
    params = urlencode(params)
    
    if method and method.lower() =="get":
        f = urllib.urlopen("%s?%s" % (request_url, params))
    else:
        f = urllib.urlopen(request_url, params)
 
    content = f.read()
    print content

   
def main():
    
    domain="http://api.xiaocongjisuan.com/";
    servlet="life/idiom/get"
    method="get"
    request_url=domain+servlet
    
    #字典
    params ={}
    params["appKey"]=app_key
    params["openId"]=open_id
    
    #变动部分
    params["currentPage"]=1
    params["pageSize"]=10
    
    request_content(request_url,params,method)
    
if __name__ == '__main__':
    main()
PHP
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<?php

/**
 * @author 
 * @copyright 2019
 */
 
header("content-type:text/html;charset=utf-8");         //设置编码
 
//配置您申请的appKey和openId
$app_key = "***";
$open_id = "***";

/**
$url 请求地址
$params 请求参数
$ispost 请求方法
*/

function http_curl($url,$params=false,$ispost=false){
   
    $httpInfo = array();
    $ch = curl_init();

    curl_setopt( $ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_1 );
    curl_setopt( $ch, CURLOPT_USERAGENT , "xiaocongjisuan");
    curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT , 60 );
    curl_setopt( $ch, CURLOPT_TIMEOUT , 60);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER , true );
    
    if( $ispost )
    {
        curl_setopt( $ch , CURLOPT_POST , true );
        curl_setopt( $ch , CURLOPT_POSTFIELDS , $params );
        curl_setopt( $ch , CURLOPT_URL , $url );
    }
    else
    {
        if($params){
            curl_setopt( $ch , CURLOPT_URL , $url.'?'.$params );
        }else{
            curl_setopt( $ch , CURLOPT_URL , $url);
        }
    }
    
    $response = curl_exec( $ch );
    if ($response === FALSE) {
        //echo "cURL Error: " . curl_error($ch);
        return false;
    }
    $httpCode = curl_getinfo( $ch , CURLINFO_HTTP_CODE );
    $httpInfo = array_merge( $httpInfo , curl_getinfo( $ch ) );
    curl_close( $ch );
    
    return $response;
}

function main(){
    
    global $app_key;
    global $open_id;
    
    $domain="http://api.xiaocongjisuan.com/";
    $servlet="life/idiom/get";
    $method="get";
    
    $url=$domain."".$servlet;
    
    $params['appKey']=$app_key;
    $params['openId']=$open_id;
    
    //变动部分
    $params["currentPage"]=1;
    $params["pageSize"]=10;

    //编码转换
    foreach ($params as $key=>$value) {
        $params[$key]=mb_convert_encoding($value, "UTF-8", "GBK");
    }

    $paramstring = http_build_query($params);
    $content = http_curl($url,$paramstring,true);
    
    return $content;
}

echo main();
?>
C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        private static string appKey="yours";
        private static string openId = "yours";
       
        static string getResponseAsString(HttpWebResponse rsp, Encoding encoding)
        {
            System.IO.Stream stream = null;
            StreamReader reader = null;
            try
            {
                // 以字符流的方式读取HTTP响应
                stream = rsp.GetResponseStream();
                reader = new StreamReader(stream, encoding);
                return reader.ReadToEnd();
            }
            finally
            {
                // 释放资源
                if (reader != null) reader.Close();
                if (stream != null) stream.Close();
                if (rsp != null) rsp.Close();
            }
        }

        /*
         * parameters 参数
         * encode 编码
         */

        static string buildQuery(IDictionary<string,object> parameters, string encode)
        {
            StringBuilder postData = new StringBuilder();
            bool hasParam = false;
            IEnumerator<KeyValuePair<string, object>> dem = parameters.GetEnumerator();
            while (dem.MoveNext())
            {
                string name = dem.Current.Key;
                string value = dem.Current.Value.ToString(); ;
                // 忽略参数名或参数值为空的参数
                if (!string.IsNullOrEmpty(name))//&& !string.IsNullOrEmpty(value)
                {
                    if (hasParam)
                    {
                        postData.Append("&");
                    }
                    postData.Append(name);
                    postData.Append("=");
                    if (encode == "gb2312")
                    {
                        postData.Append(System.Web.HttpUtility.UrlEncode(value, Encoding.GetEncoding("gb2312")));
                    }
                    else if (encode == "utf8")
                    {
                        postData.Append(System.Web.HttpUtility.UrlEncode(value, Encoding.UTF8));
                    }
                    else
                    {
                        postData.Append(value);
                    }
                    hasParam = true;
                }
            }
            return postData.ToString();
        }


        /**
        *
        * @param url 请求地址
        * @param params 请求参数
        * @param method 请求方法
        * @return 请求结果
        * @throws Exception
        */
        static string requestContent(string url, IDictionary<string,object> parameters, string method)
        {
            if (method.ToLower() == "post")
            {
                HttpWebRequest req = null;
                HttpWebResponse rsp = null;
                System.IO.Stream reqStream = null;
                try
                {
                    req = (HttpWebRequest)WebRequest.Create(url);
                    req.Method = method;
                    req.KeepAlive = false;
                    req.ProtocolVersion = HttpVersion.Version10;
                    req.Timeout = 5000;
                    req.ContentType = "application/x-www-form-urlencoded;charset=utf-8";
                    byte[] postData = Encoding.UTF8.GetBytes(buildQuery(parameters, "utf8"));
                    reqStream = req.GetRequestStream();
                    reqStream.Write(postData, 0, postData.Length);
                    rsp = (HttpWebResponse)req.GetResponse();
                    Encoding encoding = Encoding.GetEncoding(rsp.CharacterSet);
                    return getResponseAsString(rsp, encoding);
                }
                catch (Exception ex)
                {
                    return ex.Message;
                }
                finally
                {
                    if (reqStream != null) reqStream.Close();
                    if (rsp != null) rsp.Close();
                }
            }
            else
            {
                //创建请求
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url + "?" + buildQuery(parameters, "utf8"));

                //GET请求
                request.Method = "GET";
                request.ReadWriteTimeout = 5000;
                request.ContentType = "text/html;charset=UTF-8";
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                Stream myResponseStream = response.GetResponseStream();
                StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));

                //返回内容
                string retString = myStreamReader.ReadToEnd();
                return retString;
            }
        }

        static void Main(string[] args)
        {

            String domain = "http://api.xiaocongjisuan.com/";
            String servlet = "life/idiom/get";
            String method = "get";
            String url = domain + servlet;


            var parameters = new Dictionary<string,object>();

            parameters.Add("appKey", appKey);
            parameters.Add("openId", openId);

            //变动部分
            parameters.Add("currentPage", 1);
            parameters.Add("pageSize", 10);

            string result = requestContent(url, parameters, method);
            Console.WriteLine(result);
            Console.Read();

        }

    }
}

GO
package main

import (
    "io/ioutil"
    "net/http"
    "net/url"
    "fmt"
	"strings"
)
 
//配置您申请的appKey和openId
const APP_KEY ="yours";
const OPEN_ID ="yours";

func requestContent(requestUrl string,params url.Values,method string)(rs[]byte ,err error){
	
	if strings.ToUpper(method)=="GET"{
		return get(requestUrl,params)
	}
	return post(requestUrl,params)
}

// get 网络请求
func get(requestUrl string,params url.Values)(rs[]byte ,err error){
    var Url *url.URL
    Url,err=url.Parse(requestUrl)
    if err!=nil{
        fmt.Printf("解析url错误:\r\n%v",err)
        return nil,err
    }
    //如果参数中有中文参数,这个方法会进行URLEncode
    Url.RawQuery=params.Encode()
    resp,err:=http.Get(Url.String())
    if err!=nil{
        fmt.Println("err:",err)
        return nil,err
    }
    defer resp.Body.Close()
    return ioutil.ReadAll(resp.Body)
}
 
// post 网络请求 ,params 是url.Values类型
func post(requestUrl string, params url.Values)(rs[]byte,err error){
    resp,err:=http.PostForm(requestUrl, params)
    if err!=nil{
        return nil ,err
    }
    defer resp.Body.Close()
    return ioutil.ReadAll(resp.Body)
}

func main(){

	domain :="http://api.xiaocongjisuan.com/"

	servlet :="life/idiom/get"
	method :="get"
	requestUrl:=domain+servlet
	
    //初始化参数
    params:=url.Values{}
	
	params.Set("appKey",APP_KEY)
	params.Set("openId",OPEN_ID)
	
	//变动部分
	params.Set("currentPage","1")
	params.Set("pageSize","10")
 
 
    //发送请求
    data,err:=requestContent(requestUrl,params,method)
    fmt.Println(string(data))
	if err!=nil{
        fmt.Printf("解析url错误:\r\n%v",err)
    }
}	
NODEJS
var http = require('http'); 
var qs = require('querystring'); 

//配置您申请的appKey和openId
app_key = "***";
open_id = "***";
 
function request_content(request_url,port,params,method){
	
	var path=request_url;
	if(!!params){
		var content = qs.stringify(params);  
		path=request_url+'?' + content;
	}
	
	var options = { 
		port: port,
		path: path,
		method: method
	}; 
	
	if(method.toLowerCase()=='post'){
		options['headers']="Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8";
	}

	var req = http.request(options, function (res) { 
		res.setEncoding('utf8'); 
		res.on('data', function (chunk) { 
			console.log(chunk); 
		}); 
	});  
	
	req.on('error', function (e) { 
		console.log('problem with request: ' + e.message); 
	}); 
	
	req.end();
}

function main(){

	var domain="http://api.xiaocongjisuan.com/";
	var port=8080;//http对应80端口,https 对应443端口,请使用者自己改正
	var servlet="life/idiom/get";
	var method="get";
	var request_url=domain+servlet;

	var params = {}; 
	params['appKey']=app_key;
    params['openId']=open_id;
	
	//变动部分
    params["currentPage"]=1;
    params["pageSize"]=10;
	
	request_content(request_url,port,params,method);
}

main();