Url
Overview
Represents a Uniform Resource Locator, a pointer to a resource on the World Wide Web.
Use case
You can use URL class to specify some resource and get access to individual part of an url, for example:
var Url := new Sugar.Url("http://example.com/index.html");
writeLn(Url.Host);
writeLn(Url.Path);
writeLn(Url.Scheme);
Output:
example.com
/index.html
http
Location
- Reference: Sugar
- Namespace: Sugar
constructor
Creates a new instance of the class with specified parameter.
constructor(UriString: String)
Url(String UriString)
init(_ UriString: String)
Url(String UriString)
Sub New(UriString As String)
Parameters:
- UriString: String representation of the url.
Fragment
Gets the escaped url fragment.
property Fragment: String read;
String Fragment { get; }
var Fragment: String { get{} }
String Fragment { __get; }
ReadOnly Property Fragment() As String
GetParentUrl mapped
method GetParentUrl: Url
Url GetParentUrl()
func GetParentUrl() -> Url
Url GetParentUrl()
Function GetParentUrl() As Url
GetSubUrl mapped
Parameters:
- aName:
Host
Gets the host component.
property Host: String read;
String Host { get; }
var Host: String { get{} }
String Host { __get; }
ReadOnly Property Host() As String
Path
Gets the absolute path of the url.
property Path: String read;
String Path { get; }
var Path: String { get{} }
String Path { __get; }
ReadOnly Property Path() As String
Port
Gets the port numbe or -1
in case it wasn't specified.
property Port: Int32 read;
Int32 Port { get; }
var Port: Int32 { get{} }
Int32 Port { __get; }
ReadOnly Property Port() As Int32
QueryString
Gets any query information.
property QueryString: String read;
String QueryString { get; }
var QueryString: String { get{} }
String QueryString { __get; }
ReadOnly Property QueryString() As String
Scheme
Gets the scheme name.
property Scheme: String read;
String Scheme { get; }
var Scheme: String { get{} }
String Scheme { __get; }
ReadOnly Property Scheme() As String
UrlEncodeString
Parameters:
- aString:
UserInfo
Gets the user name, password, or other user-specific information.
Fragment
Gets the escaped url fragment.
property Fragment: String read;
String Fragment { get; }
var Fragment: String { get{} }
String Fragment { __get; }
ReadOnly Property Fragment() As String
Host
Gets the host component.
property Host: String read;
String Host { get; }
var Host: String { get{} }
String Host { __get; }
ReadOnly Property Host() As String
Path
Gets the absolute path of the url.
property Path: String read;
String Path { get; }
var Path: String { get{} }
String Path { __get; }
ReadOnly Property Path() As String
Port
Gets the port numbe or -1
in case it wasn't specified.
property Port: Int32 read;
Int32 Port { get; }
var Port: Int32 { get{} }
Int32 Port { __get; }
ReadOnly Property Port() As Int32
QueryString
Gets any query information.
property QueryString: String read;
String QueryString { get; }
var QueryString: String { get{} }
String QueryString { __get; }
ReadOnly Property QueryString() As String
Scheme
Gets the scheme name.
property Scheme: String read;
String Scheme { get; }
var Scheme: String { get{} }
String Scheme { __get; }
ReadOnly Property Scheme() As String
UserInfo
Gets the user name, password, or other user-specific information.
UrlEncodeString
Parameters:
- aString:
constructor
Creates a new instance of the class with specified parameter.
constructor(UriString: String)
Url(String UriString)
init(_ UriString: String)
Url(String UriString)
Sub New(UriString As String)
Parameters:
- UriString: String representation of the url.
GetParentUrl mapped
method GetParentUrl: Url
Url GetParentUrl()
func GetParentUrl() -> Url
Url GetParentUrl()
Function GetParentUrl() As Url
GetSubUrl mapped
Parameters:
- aName: