メインコンテンツまでスキップ

付録 B. URI の例

以下の例は, さまざまな Uri オプションのセットと, それらから URI を構築した結果を示しています。オプションに加えて, セクション6.5 は宛先 IP アドレスとポートを参照していますが, アルゴリズムのすべてのパスが宛先 IP アドレスとポートを URI に含めるわけではありません。

  • 入力:
Destination IP Address = [2001:db8::2:1]
Destination UDP Port = 5683

出力:

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

出力:

coap://example.net/
  • 入力:
Destination IP Address = [2001:db8::2:1]
Destination UDP Port = 5683
Uri-Host = "example.net"
Uri-Path = ".well-known"
Uri-Path = "core"

出力:

coap://example.net/.well-known/core
  • 入力:
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

出力:

coap://xn--18j4d.example/
%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF

(改行は読みやすさのために挿入されています; これは URI の一部ではありません。)

  • 入力:
Destination IP Address = 198.51.100.1
Destination UDP Port = 61616
Uri-Path = ""
Uri-Path = "/"
Uri-Path = ""
Uri-Path = ""
Uri-Query = "//"
Uri-Query = "?&"

出力:

coap://198.51.100.1:61616//%2F//?%2F%2F&?%26