• kepware http接口 java语言开发


    读取某变量的值(OK HTTP

    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("http://127.0.0.1:39321/iotgateway/read?ids=Channel1.Device1.tag1,Channel1.Device1.tag2")
      .get()
      .addHeader("Connection", "keep-alive")
      .addHeader("Cache-Control", "max-age=0")
      .addHeader("Upgrade-Insecure-Requests", "1")
      .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36")
      .addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
      .addHeader("Accept-Encoding", "gzip, deflate, br")
      .addHeader("Accept-Language", "zh-CN,zh;q=0.9")
      .addHeader("cache-control", "no-cache")
      .addHeader("Postman-Token", "78b18b05-546a-4eba-aed9-a977e507939d")
      .build();
    
    Response response = client.newCall(request).execute();

    读取某变量的值(UNIREST

    HttpResponse<String> response = Unirest.get("http://127.0.0.1:39321/iotgateway/read?ids=Channel1.Device1.tag1,Channel1.Device1.tag2")
      .header("Connection", "keep-alive")
      .header("Cache-Control", "max-age=0")
      .header("Upgrade-Insecure-Requests", "1")
      .header("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36")
      .header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
      .header("Accept-Encoding", "gzip, deflate, br")
      .header("Accept-Language", "zh-CN,zh;q=0.9")
      .header("cache-control", "no-cache")
      .header("Postman-Token", "35846625-f44e-4723-aadd-ccefac8b4d41")
      .asString();

    浏览全部变量(OK HTTP

    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("http://127.0.0.1:39321/iotgateway/browse")
      .get()
      .addHeader("Connection", "keep-alive")
      .addHeader("Cache-Control", "max-age=0")
      .addHeader("Upgrade-Insecure-Requests", "1")
      .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36")
      .addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
      .addHeader("Accept-Encoding", "gzip, deflate, br")
      .addHeader("Accept-Language", "zh-CN,zh;q=0.9")
      .addHeader("cache-control", "no-cache")
      .addHeader("Postman-Token", "fd5d3981-71c7-4af0-9080-8ab0b1b6a6f4")
      .build();
    
    Response response = client.newCall(request).execute();

    浏览全部变量(UNIREST

    HttpResponse<String> response = Unirest.get("http://127.0.0.1:39321/iotgateway/browse")
      .header("Connection", "keep-alive")
      .header("Cache-Control", "max-age=0")
      .header("Upgrade-Insecure-Requests", "1")
      .header("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36")
      .header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
      .header("Accept-Encoding", "gzip, deflate, br")
      .header("Accept-Language", "zh-CN,zh;q=0.9")
      .header("cache-control", "no-cache")
      .header("Postman-Token", "ae3420de-9c68-433f-a638-0ac7e6dbd5f2")
      .asString();
  • 相关阅读:
    python调c++之caffe实现
    coco数据处理与分割
    一个队列类的实现(比delphi自带的速度快70倍) 转
    临界区对象TCriticalSection(Delphi) 与 TRtlCriticalSection 的区别(转)
    缇、像素转厘米的方法
    缇 磅 像素
    delphi RTTI 反射技术(转自朝闻道博客)
    emrDB本机异地泵导双备份并自动压缩 新.bat
    ORA-01589错误 要打开数据库则必须使用 RESETLOGS 或 NORESETLOGS 选项
    Oracle ORA-01033: 错误解决办法
  • 原文地址:https://www.cnblogs.com/dXIOT/p/10626562.html
Copyright © 2020-2023  润新知