读取某变量的值(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开发的更多相关文章

  1. kepware http接口 GO语言开发

    读取某变量的值 package main import ( "fmt" "net/http" "io/ioutil" ) func main ...

  2. kepware http接口 java语言开发

    读取某变量的值(OK HTTP OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .u ...

  3. Windows下搭建objective C开发环境

    摘自:http://blog.csdn.net/zhanghefu/article/details/18320827 最近打算针对iPhone.iPod touch和iPad开发一些应用,所以,需要开 ...

  4. Windows在结构objective C开发环境

    对于近期打算iPhone.iPod touch和iPad开发一些应用程序,所以.需要开始学习Objective C(苹果推出的类似C语言的开发语言).因为苹果的自我封闭的产业链发展模式(从芯片.机器. ...

  5. 早期MyBatis开发与接口式Mybatis开发的简介

    早期MyBatis开发与接口式Mybatis开发的简介 一.早期版本的myBatis使用 导jar包            1.配置mybatis.xml的配置文件                1) ...

  6. 小D课堂【SpringBoot】接口Http协议开发实战

    ---恢复内容开始--- ====================2.SpringBoot接口Http协议开发实战 ============================= 1.SpringBoot ...

  7. C#二次开发BIMFACE系列61 File Management文件管理服务接口二次开发及实战详解

    系列目录     [已更新最新开发文章,点击查看详细] 在我的博客<C#二次开发BIMFACE系列61 File Management文件管理服务接口二次开发及实战详解>最后列出了 Fil ...

  8. kepware http接口 nodejs开发

    读取某变量的值(native var http = require("http"); var options = { "method": "GET&q ...

  9. kepware http接口 javascript开发

    读取某变量的值(jquery var settings = { "async": true, "crossDomain": true, "url&qu ...

随机推荐

  1. c# sharpsvn 客户端开发测试

    1:没有工作副本,上传时会报错的. 会提示本地目录不是not a working copy   而此中文名称就是工作副本, 本地要与svn服务器公用的一个文件夹. 所以每次要checkout 然后才能 ...

  2. 19.Mysql优化数据库对象

    19.优化数据库对象19.1 优化表的数据类型应用设计时需要考虑字段的类型和长度,并留有一定长度冗余.procedure analyse()函数可以对表中列的数据类型提出优化建议.procedure ...

  3. hdu 5461(2015沈阳网赛 简单暴力) Largest Point

    题目;http://acm.hdu.edu.cn/showproblem.php?pid=5461 题意就是在数组中找出a*t[i]*t[i]+b*t[j]的最大值,特别注意的是这里i和i不能相等,想 ...

  4. IntelliJ idea 的破解

    ·1.破解的jar包下载链接: https://pan.baidu.com/s/1JV6GwguGQNs5pNQtst29Hw  提取码: u2jd 2.安装和破解地址:https://www.cnb ...

  5. Startup.国外新锐公司及其技术Blog

    国外技术公司Tech/Engineering Blog 1. vimeo https://coderwall.com/team/vimeo http://blog.assembly.com/ 2. l ...

  6. magento中根据用户的id获取用户的所有订单以及每个订单中的物品 以及物品的相关属性

    本篇文章是对于已经有了magento基础的人而言,在某个模块的额controller中写任意一个函数. public function goodbyeAction() { for ($customer ...

  7. mfc获取exe的版本信息

    CString GetFileVersion(const CString& sTargetFileName){ DWORD nInfoSize = 0, dwHandle = 0; nInfo ...

  8. mysql bigint ,int , smallint,tinyint 的范围

    bigint  8字节 64位 int 4字节 32位 smallint 2字节 16位 tinyint 1字节8位 .. 范围  -128 到 127  , 如果是无符号 ,则返回 位 0-255 ...

  9. IOS初级:NSUserDefaults

    NSUserDefaults(偏好设置),一个APP对应一个偏好设置 保存/新增数据 //存储数据 NSUserDefaults *defaults = [NSUserDefaults standar ...

  10. Windows8 App Store 开发者会关心的文档

    在远程计算机上从 Visual Studio 调试和测试 Windows 应用商店应用程序 http://msdn.microsoft.com/zh-cn/library/windows/apps/h ...