當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


erlang recompose(URIMap)用法及代碼示例


recompose(URIMap) -> URIString
OTP 21.0
類型:
URIMap = uri_map()
URIString = uri_string() | error()

創建一個RFC 3986合規的URIString(百分比編碼),基於以下組件URIMap。如果URIMap無效,返回錯誤元組。

另請參閱相反的操作 parse/1.

例子:

1> URIMap = #{fragment => "nose", host => "example.com", path => "/over/there",
1> port => 8042, query => "name=ferret", scheme => "foo", userinfo => "user"}.
#{fragment => "nose",host => "example.com",
  path => "/over/there",port => 8042,query => "name=ferret",
  scheme => "foo",userinfo => "user"}

2> uri_string:recompose(URIMap).
"foo://example.com:8042/over/there?name=ferret#nose"

相關用法


注:本文由純淨天空篩選整理自erlang.org大神的英文原創作品 recompose(URIMap) -> URIString。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。