基于JA V A的周易解梦接口调用代码实例
代码描述:基于JA V A的周易解梦接口调用代码实例
代码平台:聚合数据
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 http://www.doczj.com/doc/1c0ee415ad51f01dc381f130.html.HttpURLConnection;
import http://www.doczj.com/doc/1c0ee415ad51f01dc381f130.html.URL;
import http://www.doczj.com/doc/1c0ee415ad51f01dc381f130.html.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import net.sf.json.JSONObject;
/**
*周公解梦调用示例代码-聚合数据
*在线接口文档:http://www.doczj.com/doc/1c0ee415ad51f01dc381f130.html/docs/64
**/
public class JuheDemo {
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) Appl eWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36";
//配置您申请的KEY
public static final String APPKEY ="*************************";
//1.类型
public static void getRequest1(){
String result =null;
String url ="http://www.doczj.com/doc/1c0ee415ad51f01dc381f130.html/dream/category";//请求接口地址
Map params = new HashMap();//请求参数
params.put("key",APPKEY);//应用APPKEY(应用详细页查询)
params.put("fid","");//所属分类,默认全部,0:一级分类