kepware http接口 Objective-C开发
读取某变量的值(NSURL
#import <Foundation/Foundation.h>
NSDictionary *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"};
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://127.0.0.1:39321/iotgateway/read?ids=Channel1.Device1.tag1,Channel1.Device1.tag2"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
列出所有变量
#import <Foundation/Foundation.h>
NSDictionary *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" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://127.0.0.1:39321/iotgateway/browse"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
kepware http接口 Objective-C开发的更多相关文章
- kepware http接口 GO语言开发
读取某变量的值 package main import ( "fmt" "net/http" "io/ioutil" ) func main ...
- kepware http接口 java语言开发
读取某变量的值(OK HTTP OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .u ...
- Windows下搭建objective C开发环境
摘自:http://blog.csdn.net/zhanghefu/article/details/18320827 最近打算针对iPhone.iPod touch和iPad开发一些应用,所以,需要开 ...
- Windows在结构objective C开发环境
对于近期打算iPhone.iPod touch和iPad开发一些应用程序,所以.需要开始学习Objective C(苹果推出的类似C语言的开发语言).因为苹果的自我封闭的产业链发展模式(从芯片.机器. ...
- 早期MyBatis开发与接口式Mybatis开发的简介
早期MyBatis开发与接口式Mybatis开发的简介 一.早期版本的myBatis使用 导jar包 1.配置mybatis.xml的配置文件 1) ...
- 小D课堂【SpringBoot】接口Http协议开发实战
---恢复内容开始--- ====================2.SpringBoot接口Http协议开发实战 ============================= 1.SpringBoot ...
- C#二次开发BIMFACE系列61 File Management文件管理服务接口二次开发及实战详解
系列目录 [已更新最新开发文章,点击查看详细] 在我的博客<C#二次开发BIMFACE系列61 File Management文件管理服务接口二次开发及实战详解>最后列出了 Fil ...
- 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 ...
随机推荐
- js分割数字
var str = "123"; var b = String(str).split(''); 打印b[0].b[1].b[2]看效果...
- phpstorm+xdebug调试代码
1工具 #phpstorm 前面有文章介绍如何安装 #phpStudy 官网下的2018最新的安装包,php环境使用的也是最新的php7.0nts 2开启php Xdebug拓展 开启拓展,phpSt ...
- PCR技术
qRT-PCR是指先由RNA进行反转录生成cDNA,然后以cDNA为模板进行检测,检测的是该cDNA的含量,而cDNA由特定的RNA逆转录而来,所以间接地检测了RNA的含量. 基因表达: 转录:DNA ...
- Jsonpath的基本使用
JSONPath - 是xpath在json的应用. xml最大的优点就有大量的工具可以分析,转换,和选择性的提取文档中的数据.XPath是这些最强大的工具之一. 如果可以使用xpath来解析js ...
- 性能监控工具——Cacti安装文档
一.Cacti安装说明 1.安装说明 一般性的安装说明,详细的操作系统具体的安装说明可用于Linux. 2.服务器安装要求 RRDTool 1.2.x或更高版本 MySQL 4.1.x或5.x更高版本 ...
- echo 变量不加引号出错
result=`ps aux | grep “×××” |grep -v “×××” start_time=$(echo $result | awk '{print $9}') 问题:发现输出是 s ...
- 我的MVP呢?
Ladies and gentelmen, welcome the MVP of NBA 16-2017 Season:... 呃,等下,好像哪里不对.那是因为,我要说的MVP根本就不是Most Va ...
- sql 用Group by分组后,取每组的前几条记录
转自:http://blog.163.com/jeson_lwj/blog/static/135761083201052411115783/ --查询每门课程的前2名成绩 CREATE TABLE S ...
- R及Rstudio 的使用建议
对于新人来说,进行R的学习时,通常会发现一般的教程都是让大家在交互环境下使用R. 但是这有一些缺点,比如在交换环境下,出现错误是难以撤销的,有的时候甚至需要重头做起.尤其是在Rstudio的交互环境下 ...
- chrome、firefox表单自动提交诱因 -- 非type=hidden的单输入域(input)
开发任务中遇到很费解的一个form自动提交问题,form中只有一个input时回车会触发自动提交表单,当在多一个非type=hidden的input时,又不会出现表单自动提交. 代码示例: 会出现自动 ...