读取某变量的值

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的更多相关文章

  1. kepware http接口 c语言 ruby

    读取某变量的值 require 'uri' require 'net/http' url = URI("http://127.0.0.1:39321/iotgateway/read?ids= ...

  2. kepware http接口 GO语言开发

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

  3. kepware http接口 php

    读取某变量的值(HttpRequest <?php $request = new HttpRequest(); $request->setUrl('http://127.0.0.1:393 ...

  4. kepware http接口 c语言 python

    读取某变量的值(http.client import http.client conn = http.client.HTTPConnection("127,0,0,1") head ...

  5. kepware http接口 OCaml

    读取某变量的值 open Cohttp_lwt_unix open Cohttp open Lwt let uri = Uri.of_string "http://127.0.0.1:393 ...

  6. kepware http接口 Objective-C开发

    读取某变量的值(NSURL #import <Foundation/Foundation.h> NSDictionary *headers = @{ @"Connection&q ...

  7. kepware http接口 nodejs开发

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

  8. kepware http接口 javascript开发

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

  9. kepware http接口 java语言开发

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

随机推荐

  1. hangfire enqueued but not processing(hangfire 定时任务入队列但不执行)

    不生效的方法 //RecurringJob.AddOrUpdate<FamilyAppService>((s) => s.UpdateFamilyLevel(), input.Cro ...

  2. JwtBearerAppBuilderExtensions.UseJwtBearerAuthentication(IApplicationBuilder

    netcore从1.1升级到2.0时,出的错,因为使用的时Jwt token参考https://github.com/aspnet/Security/issues/1310#issuecomment- ...

  3. 4C - 七夕节

    七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" 人们纷纷来到告示前,都想知道谁才是自己 ...

  4. Oracle的SQL语句中如何处理‘&’符号

    ‘&’符号在SQL中有特殊含义,所以在SQL中想要写入&,需要特殊处理. 如下SQL语句就不能正确运行: SQL> select 'a&b' from dual; 处理方 ...

  5. PAT 1067 试密码(20)(代码)

    1067 试密码(20 分) 当你试图登录某个系统却忘了密码时,系统一般只会允许你尝试有限多次,当超出允许次数时,账号就会被锁死.本题就请你实现这个小功能. 输入格式: 输入在第一行给出一个密码(长度 ...

  6. iOS.Objective-C.Dependency.Graphing-v0.1

    当Project越来越复杂,模块间的依赖就会很复杂,不合理的依赖就出现:不必要的依赖,双向依赖等等. 在iOS Application Project中可以将依赖定义为:对某个头文件的import. ...

  7. Luogu 1641[SCOI2010]生成字符串 - 卡特兰数

    Description 有$N$ 个 $1$ 和 $M$ 个 $0$ 组成的字符串, 满足前 $k$ 个字符中 $1$ 的个数不少于 $0$ 的个数. 求这样字符串的个数. $1<=M < ...

  8. 在nginx中,禁止IP访问.只可以使用域名访问.

    if ($host ~* "\d+\.\d+\.\d+\.\d+"){ ; } 其实说白了, 就是进行host主机头过滤,使用正则来判断下.

  9. Codeforces 791C. Bear and Different Names 模拟构造

    C. Bear and Different Names time limit per test:1 second memory limit per test:256 megabytes input:s ...

  10. MySQL中varchar与char区别

    MySQL中varchar与char区别(转) MySQL中varchar最大长度是多少? 一. varchar存储规则: 4.0版本以下,varchar(20),指的是20字节,如果存放UTF8汉字 ...