首页 > 编程语言 > 详细

kepware http接口 c语言 ruby

时间:2019-03-30 13:54:54      阅读:168      评论:0      收藏:0      [点我收藏+]

 

读取某变量的值

require uri
require net/http

url = URI("http://127.0.0.1:39321/iotgateway/read?ids=Channel1.Device1.tag1,Channel1.Device1.tag2")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Connection"] = keep-alive
request["Cache-Control"] = max-age=0
request["Upgrade-Insecure-Requests"] = 1
request["User-Agent"] = Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36
request["Accept"] = text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
request["Accept-Encoding"] = gzip, deflate, br
request["Accept-Language"] = zh-CN,zh;q=0.9
request["cache-control"] = no-cache

response = http.request(request)
puts response.read_body

 

kepware http接口 c语言 ruby

原文:https://www.cnblogs.com/dXIOT/p/10626712.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!