读取某变量的值(http.client

import http.client

conn = http.client.HTTPConnection("127,0,0,1")

headers = {
'Connection': "keep-alive",
'Cache-Control': "max-age=0",
'Upgrade-Insecure-Requests': "",
'User-Agent': "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
'Accept-Encoding': "gzip, deflate, br",
'Accept-Language': "zh-CN,zh;q=0.9",
'cache-control': "no-cache",
} conn.request("GET", "iotgateway,read", headers=headers) res = conn.getresponse()
data = res.read() print(data.decode("utf-8"))

读取某变量的值(requests

import requests

url = "http://127.0.0.1:39321/iotgateway/read"

querystring = {"ids":["Channel1.Device1.tag1","Channel1.Device1.tag2"]}

headers = {
'Connection': "keep-alive",
'Cache-Control': "max-age=0",
'Upgrade-Insecure-Requests': "",
'User-Agent': "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
'Accept-Encoding': "gzip, deflate, br",
'Accept-Language': "zh-CN,zh;q=0.9",
'cache-control': "no-cache",
} response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)

最新文章

  1. ubuntu下常用命令(一)
  2. 下载安装与配置 Java JDK 7
  3. POJ 3304 Segments【叉积】
  4. c#部分---递归题目;猴子摘桃
  5. 基于XMPP的即时通信系统的建立(五)— openfire
  6. 再回首,Java温故知新(二):Java基本数据类型
  7. 如何查找ORACLE中的跟踪文件
  8. Passenger/Nginx/Debian快速部署Rails
  9. ubuntu开启openssh-server,ssh[xshell]
  10. 2013 QCon北京演讲:跨终端的WebKit渲染机制
  11. CentOS7安装codeblocks(转载)
  12. Servlet服务器、客户端跳转
  13. python学习(list增删改查、及常用方法)
  14. 卷积转换为矩阵运算中填充数的计算-GEMM
  15. Parallel.ForEach 多线程 声明失败 "未将对象引用设置到对象的实例"
  16. ElasticSearch权威指南学习(文档)
  17. mysql 5.7 版本的安装
  18. Codeforces 603A - Alternative Thinking - [字符串找规律]
  19. Python之路【第十一篇】: 进程与线程
  20. 2-12-配置squid代理服务器加快网站访问速度

热门文章

  1. ef linq 中判断实体中是否包含某集合
  2. js substring
  3. 25.mysql中的常用工具
  4. [转载]RPM中SPEC常用路径以及宏变量
  5. UIDataPicker 时间选择器
  6. Centos查公网IP地址
  7. django DEBUG=False
  8. Android Text Color设置不当造成信息不显示
  9. having 的用法
  10. 嵌入式C编程代码优化笔记