iotdm_api.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:iotdm-pyclient 作者: peterchauyw 项目源码 文件源码
def retrieve(URI, origin=None, requestID=None):
    uri = urlparse(URI)
    if uri.scheme == "http":
        response = ciotdm.retrieve(URI, origin, requestID)
        print str(response[0]) + '\n' + response[1]

    elif uri.scheme == "coap":
        log.startLogging(sys.stdout)
        endpoint = resource.Endpoint(None)
        protocol = coap.Coap(endpoint)
        Agent(protocol, "get", URI, origin=origin, requestID=requestID)
        reactor.listenUDP(0, protocol)
        reactor.run()

    else:
        print "Invalid protocol."
        sys.exit(2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号