下面是%Net
中其他一些有用类的简短列表:
InterSystems IRIS提供了一个实用程序类%Net.URLParser
,可以使用它将URL字符串解析为其组成部分。例如,当您重定向HTTP请求时,这很有用。
该类包含一个类方法Parse()
,它接受一个包含URL
值的字符串,并通过引用返回一个包含URL
各部分的数组。例如:
/// w ##class(PHA.TEST.HTTP).URLParser()
ClassMethod URLParser()
{
Set url = "https://www.google.com/search?q=Java+site%3Adocs.intersystems.com&oq=Java+site%3Adocs.intersystems.com"
Do ##class(%Net.URLParser).Parse(url,.components)
zw components
}
DHC-APP>w ##class(PHA.TEST.HTTP).URLParser()
components("fragment")=""
components("host")="www.google.com"
components("netloc")="www.google.com"
components("params")=""
components("path")="/search"
components("query")="q=Java+site%3Adocs.intersystems.com&oq=Java+site%3Adocs.intersystems.com"
components("scheme")="https"
返回时,组件将包含此URL各部分的数组:
Element | Value | Description |
---|---|---|
components("fragment") | null | URL的片段(#字符后面) |
components("host") | www.google.com | URL请求的主机 |
components("netloc") | www.google.com | URL的网络地址 |
components("params") | URL中包含的URL参数 | |
components("path") | /search | URL的文件路径 |
components("query") | q=Java+site%3Adocs.intersystems.com&oq=Java+site%3Adocs.intersystems.com | URL中包含的查询字符串 |
components("scheme") | https | 此URL指定的传输方案 |
可以使用%Net.Charset
表示InterSystems IRIS内的MIME字符集,并将这些字符集映射到InterSystems IRIS区域设置。此类包括以下类方法:
GetDefaultCharset()
返回当前InterSystems IRIS区域设置的默认字符集。GetTranslateTable()
返回给定输入字符集的InterSystems IRIS转换表的名称。TranslateTableExists()
指示是否已加载给定字符集的转换表。可以使用%Net.TelnetStream
模拟Windows NT Telnet.exe
的握手行为。
%Net
包提供了许多用于身份验证和安全性的类。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。