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 ...
随机推荐
- mySLQ数据库 练习题
MySQL 练习题1 DROP TABLE IF EXISTS `liuyan`; CREATE TABLE `liuyan` ( `id` int(11) NOT NULL AUTO_INCREME ...
- Python 列表推导实例
#!/usr/bin/python # -*- coding: utf-8 -*- with open('e:/123.txt') as fp:row = fp.readlines() #打开并读取所 ...
- (转)无效的CurrentPageIndex 值。它必须大于等于0 且小于PageCount 解决方案
第一种: 当以某种条件来查询的时候 其中的结果是以一个结果为条件的datagrid分页 采用字查询到条件下加入如下代码: [c-sharp] view plaincopyprint? protecte ...
- 利用Swoole编写一个TCP服务器,顺带测试下Swoole的4层生命周期
1首先我们写一个入口脚本,这里简单点的功能就是开启服务和关闭服务 <?php //CLI命令 if(isset($argv[1]) && in_array($argv[1], [ ...
- BPF+XDP比较全的资料都在这里
Dive into BPF: a list of reading material Sep 1, 2016 • Quentin Monnet◀Table of contents What is BPF ...
- python下的MySQL数据库编程
https://www.tutorialspoint.com/python/python_database_access.htm if you need to access an Oracle dat ...
- CentOS 7.0 安装配置LAMP服务器方法(Apache+PHP+MariaDB)(转)
转自:http://www.jb51.net/os/188488.html 作者:佚名 字体:[增加 减小] 来源:osyunwei 准备篇: CentOS 7.0系统安装配置图解教程 http:/ ...
- Spring IOC(一)体系结构
Spring IOC(一)体系结构 Spring 系列目录(https://www.cnblogs.com/binarylei/p/10198698.html) BeanFactory 是Spring ...
- mysql完装成功后的提示。
To start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your ...
- C#动态显示时间
private void timer1_Tick(object sender, EventArgs e) { DateTime dt = DateTime.Now; label1.Text = dt. ...