本文整理汇总了Python中coapthon.messages.request.Request.uri_query方法的典型用法代码示例。如果您正苦于以下问题:Python Request.uri_query方法的具体用法?Python Request.uri_query怎么用?Python Request.uri_query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coapthon.messages.request.Request
的用法示例。
在下文中一共展示了Request.uri_query方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_td_coap_link_02
# 需要导入模块: from coapthon.messages.request import Request [as 别名]
# 或者: from coapthon.messages.request.Request import uri_query [as 别名]
def test_td_coap_link_02(self):
print "TD_COAP_LINK_02"
path = "/.well-known/core"
req = Request()
req.code = defines.Codes.GET.number
req.uri_path = path
req.type = defines.Types["CON"]
req._mid = self.current_mid
req.destination = self.server_address
req.uri_query = "rt=Type1"
expected = Response()
expected.type = defines.Types["ACK"]
expected._mid = self.current_mid
expected.code = defines.Codes.CONTENT.number
expected.token = None
expected.content_type = defines.Content_types["application/link-format"]
expected.payload = """</seg1/seg2/seg3>;rt="Type1",</seg1/seg2>;rt="Type1",</test>;rt="Type1",</seg1>;rt="Type1",</query>;rt="Type1","""
self.current_mid += 1
self._test_with_client([(req, expected)])