Skip to main content

Appendix B. URI Examples

Appendix B. URI Examples

The following examples demonstrate different sets of Uri options, and the result after constructing an URI from them. In addition to the options, Section 6.5 refers to the destination IP address and port, but not all paths of the algorithm cause the destination IP address and port to be included in the URI.

Example 1:

  • Input:
Destination IP Address = [2001:db8::2:1]
Destination UDP Port = 5683
  • Output:
coap://[2001:db8::2:1]/

Example 2:

  • Input:
Destination IP Address = [2001:db8::2:1]
Destination UDP Port = 5683
Uri-Host = "example.net"
  • Output:
coap://example.net/

Example 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

Example 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

(The line break has been inserted for readability; it is not part of the URI.)

Example 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