请问下华东2官方的服务器端php-sdk好用不
Re请问下华东2官方的服务器端php-sdk好用不
Python 2.7.6测试OK, 代码如下
#!/usr/bin/python# -*- coding: UTF-8 -*-from aliyunsdkcore import clientfrom aliyunsdkiot.request.v20170420 import RegistDeviceRequestfrom aliyunsdkiot.request.v20170420 import PubRequestaccessKeyId = 'xxx'accessKeySecret = 'xxx'clt = client.AcsClient(accessKeyId, accessKeySecret, 'cn-shanghai')request = PubRequest.PubRequest()request.set_accept_format('json') #设置返回数据格式,默认为XMLrequest.set_ProductKey('xxx')request.set_TopicFullName('/xxx/device_01/data') #消息发送到的Topic全名request.set_MessageContent('aGVsbG8gd29ybGQ=') #hello world Base64 Stringrequest.set_Qos(0)result = clt.do_action(request)print 'result : ' + result
赞0
踩0