博客
关于我
认知智能机器人已经来了!认知智能时代!道翰天琼认知智能未来机器人接口API简介介绍
阅读量:185 次
发布时间:2019-02-28

本文共 3185 字,大约阅读时间需要 10 分钟。

?????????????????60???chatbot?????????????????????????????????20??60???90????chatbot????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

  • ???????????????
  • ?????????????????
  • ???????????????????
  • ??????????????????????????
  • ?????????????????????????

  • ????????????????????????????????????????HNC???????
  • ??????????????????????????????????????
  • ??????????????????????????????????????????
  • ??????????????????????????????
  • ????????????????????????????????????

    ?????????

    ???????????????????????

  • ??APIKEY??????????????????????APIKEY?
  • ?????IP?????????????????IP???????????QQ???
  • ???????????????GBK????????????
  • ?????????????????APIKEY?????????IP??????URL???
  • ??????

    ???????Java????????????

    import java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.UnsupportedEncodingException;import java.net.HttpURLConnection;import java.net.URL;import java.net.URLEncoder;import ai.nlp.jiekou.test.ChangLiangZi;public class ApiTest {    private static String opUrl(String urlStr) {        try {            URL url = new URL(urlStr);            HttpURLConnection conn = (HttpURLConnection) url.openConnection();            conn.setReadTimeout(5 * 10000);            conn.setConnectTimeout(5 * 10000);            conn.setRequestMethod("POST");                        if (conn.getResponseCode() == 200) {                InputStream is = conn.getInputStream();                ByteArrayOutputStream baos = new ByteArrayOutputStream();                byte[] buf = new byte[128];                int len = -1;                                while ((len = is.read(buf)) != -1) {                    baos.write(buf, 0, len);                }                baos.flush();                return baos.toString();            } else {                throw new Exception("????????");            }        } catch (Exception e) {            e.printStackTrace();        } finally {            try {                if (is != null) {                    is.close();                }                try {                    if (baos != null) {                        baos.close();                    }                } catch (IOException e) {                    e.printStackTrace();                }                conn.disconnect();            } catch (IOException e) {                e.printStackTrace();            }        }        return ChangLiangZi.WU;    }    public static void main(String[] args) {        String msg = "??????";        String apikey = "UTNJK34THXK010T566ZI39VES50BLRBE8R66H5R3FOAO84J3BV";        String ip = "127.0.0.1";        try {            msg = URLEncoder.encode(msg, "GBK");            System.out.println(opUrl("http://a239p06512.zicp.vip/Web/BuAppJava.bujqrex?apikey=" + apikey + "&msg=" + msg + "&ip=" + ip));        } catch (UnsupportedEncodingException e) {            e.printStackTrace();        }    }}

    ????

  • ???????????????????
  • ??????????????GBK?????????????
  • IP?????????IP??????????
  • ??????????POST?????
  • ???????????????????????????????????????

    转载地址:http://nuwn.baihongyu.com/

    你可能感兴趣的文章
    Objective-C实现Http Post请求(附完整源码)
    查看>>
    Objective-C实现http下载文件 (附完整源码)
    查看>>
    Objective-C实现Http协议下载文件(附完整源码)
    查看>>
    Objective-C实现huffman哈夫曼编码算法(附完整源码)
    查看>>
    Objective-C实现ID3贪心算法(附完整源码)
    查看>>
    Objective-C实现IIR 滤波器算法(附完整源码)
    查看>>
    Objective-C实现IIR数字滤波器(附完整源码)
    查看>>
    Objective-C实现insertion sort插入排序算法(附完整源码)
    查看>>
    Objective-C实现integer partition整数分区算法(附完整源码)
    查看>>
    Objective-C实现integerPartition整数划分算法(附完整源码)
    查看>>
    Objective-C实现interpolation search插值搜索算法(附完整源码)
    查看>>
    Objective-C实现Interpolation search插值查找算法(附完整源码)
    查看>>
    Objective-C实现intersection交集算法(附完整源码)
    查看>>
    Objective-C实现intro sort内省排序算法(附完整源码)
    查看>>
    Objective-C实现inverse matrix逆矩阵算法(附完整源码)
    查看>>
    Objective-C实现inversions倒置算法(附完整源码)
    查看>>
    Objective-C实现isalpha函数功能(附完整源码)
    查看>>
    Objective-C实现islower函数功能(附完整源码)
    查看>>
    Objective-C实现isPowerOfTwo算法(附完整源码)
    查看>>
    Objective-C实现isupper函数功能(附完整源码)
    查看>>