博客
关于我
认知智能机器人已经来了!认知智能时代!道翰天琼认知智能未来机器人接口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/

    你可能感兴趣的文章
    PHP大数组过滤元素、修改元素性能分析
    查看>>
    PHP大文件切片下载代码
    查看>>
    PHP如何下载远程文件到指定目录
    查看>>
    php如何优化压缩的图片
    查看>>
    php如何做表格,新手怎么制作表格
    查看>>
    RabbitMQ高级特性
    查看>>
    php如何定义的数位置,php如何实现不借助IDE快速定位行数或者方法定义的文件和位置...
    查看>>
    RabbitMQ集群 - 普通集群搭建、宕机情况
    查看>>
    php如何正确的获得文件的后缀名
    查看>>
    PHP如何生成唯一的数字ID
    查看>>
    PHP如何获取当前页面的最后修改时间
    查看>>
    PHP如何读取json数据
    查看>>
    PHP字符串
    查看>>
    PHP字符串递增
    查看>>
    php学习之基础语法
    查看>>
    RabbitMQ集群 - 仲裁队列、Raft协议(最详细的选举流程)
    查看>>
    PHP学习总结(11)——PHP入门篇之WAMPServer多站点配置
    查看>>
    PHP学习总结(12)——PHP入门篇之变量
    查看>>
    PHP学习总结(13)——PHP入门篇之常量
    查看>>
    PHP学习总结(14)——PHP入门篇之常用运算符
    查看>>