kepware http接口 swift
读取某变量的值
import Foundation let 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",
] let request = NSMutableURLRequest(url: NSURL(string: "http://127.0.0.1:39321/iotgateway/read?ids=Channel1.Device1.tag1,Channel1.Device1.tag2")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
}) dataTask.resume()
kepware http接口 swift的更多相关文章
- kepware http接口 c语言 ruby
读取某变量的值 require 'uri' require 'net/http' url = URI("http://127.0.0.1:39321/iotgateway/read?ids= ...
- kepware http接口 GO语言开发
读取某变量的值 package main import ( "fmt" "net/http" "io/ioutil" ) func main ...
- kepware http接口 php
读取某变量的值(HttpRequest <?php $request = new HttpRequest(); $request->setUrl('http://127.0.0.1:393 ...
- kepware http接口 c语言 python
读取某变量的值(http.client import http.client conn = http.client.HTTPConnection("127,0,0,1") head ...
- kepware http接口 OCaml
读取某变量的值 open Cohttp_lwt_unix open Cohttp open Lwt let uri = Uri.of_string "http://127.0.0.1:393 ...
- kepware http接口 Objective-C开发
读取某变量的值(NSURL #import <Foundation/Foundation.h> NSDictionary *headers = @{ @"Connection&q ...
- kepware http接口 nodejs开发
读取某变量的值(native var http = require("http"); var options = { "method": "GET&q ...
- kepware http接口 javascript开发
读取某变量的值(jquery var settings = { "async": true, "crossDomain": true, "url&qu ...
- kepware http接口 java语言开发
读取某变量的值(OK HTTP OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .u ...
随机推荐
- Myeclipse2013破解方法
1.先关闭Myeclipse2013 2.(1)输入usercode可以随便输入,(2)然后选择Myeclipse的版本,(3)点击systemid按钮 3.点击Tools菜单栏下的RebuildKe ...
- Liunx cp
功能: 复制文件或目录 使用权限:所有使用者说明: cp指令用于复制文件或目录,如同时指定两个以上的文件或目录,且最后的目的地是一个已经存在的目录,则它会把前面指定的所有文件或目录复制到此目录中.若同 ...
- angular2.0学习笔记6.编程风格指南
1.组件的类名应该是大驼峰形式,并且以Component结尾. 因此英雄详情组件的类名是HeroDetailComponent. 组件的文件名应该是小写中线形式,每个单词之间用中线分隔,并且以.com ...
- Linux CentOS 7 & JDK 1.7 安装与配置
前言 简单记录一下在CentOS 7中安装配置JDK 1.7的全过程~ 下载 首先是jdk 1.7 64bit & 32bit的下载地址: jdk-7u79-linux-x64.tar.gz ...
- ssm介绍
1.Spring Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,由Rod Johnson 在其著作Expert One-On-One J2EE ...
- POJ1659 Frogs' Neighborhood(青蛙的邻居) Havel-Hakimi定理
Frogs' Neighborhood Time Limit: 5000MS Memory Limit: 10000K Total Submissions: 8729 Accepted: 36 ...
- MySQL学习笔记-事务相关话题
事务机制 事务(Transaction)是数据库区别于文件系统的重要特性之一.事务会把数据库从一种一致状态转换为另一个种一致状态.在数据库提交工作时,可以确保其要么所有修改都已经保存了,要么所有修改都 ...
- R及Rstudio 的使用建议
对于新人来说,进行R的学习时,通常会发现一般的教程都是让大家在交互环境下使用R. 但是这有一些缺点,比如在交换环境下,出现错误是难以撤销的,有的时候甚至需要重头做起.尤其是在Rstudio的交互环境下 ...
- spring boot 无法启动
spring boot 使用内置tomcat 报错 : Unable to start embedded Tomcat servlet container Tomcat connector in f ...
- js 异步加载和同步加载
异步加载 异步加载也叫非阻塞模式加载,浏览器在下载js的同时,同时还会执行后续的页面处理.在script标签内,用js创建一个script元素并插入到document中,这种就是异步加载js文件了: ...