Appendix B. URI Examples (URI 示例)
Appendix B. URI Examples (URI 示例)
以下示例演示了不同的 Uri 选项集合, 以及从它们构造 URI 的结果。除了选项之外, Section 6.5 还涉及目标 IP 地址和端口, 但并非算法的所有路径都会导致目标 IP 地址和端口包含在 URI 中。
示例 1:
- Input (输入):
Destination IP Address = [2001:db8::2:1]
Destination UDP Port = 5683
- Output (输出):
coap://[2001:db8::2:1]/
示例 2:
- Input (输入):
Destination IP Address = [2001:db8::2:1]
Destination UDP Port = 5683
Uri-Host = "example.net"
- Output (输出):
coap://example.net/
示例 3:
- Input (输入):
Destination IP Address = [2001:db8::2:1]
Destination UDP Port = 5683
Uri-Host = "example.net"
Uri-Path = ".well-known"
Uri-Path = "core"
- Output (输出):
coap://example.net/.well-known/core
示例 4:
- Input (输入):
Destination IP Address = [2001:db8::2:1]
Destination UDP Port = 5683
Uri-Host = "xn--18j4d.example"
Uri-Path = the string composed of the Unicode characters U+3053
U+3093 U+306b U+3061 U+306f, usually represented in UTF-8 as
E38193E38293E381ABE381A1E381AF hexadecimal
- Output (输出):
coap://xn--18j4d.example/
%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF
(为便于阅读插入了换行符; 它不是 URI 的一部分。)
示例 5:
- Input (输入):
Destination IP Address = 198.51.100.1
Destination UDP Port = 61616
Uri-Path = ""
Uri-Path = "/"
Uri-Path = ""
Uri-Path = ""
Uri-Query = "//"
Uri-Query = "?&"
- Output (输出):
coap://198.51.100.1:61616//%2F//?%2F%2F&?%26