Skip to content

Class: cURIParser

Include: Use System\URI.pkg

Hierarchy: cObject -> cURIParser

Package: System\URI.pkg

cURIParser parses a URI into properties, lets application code update path and query values, and generates a URI from the current state.

Properties

See Properties.

Name Purpose
psScheme URI scheme.
psUser User name component.
psPassword Password component.
psHost Host component.
psPort Port component.
paPath Path segments.
psFragment Fragment without the hash marker.
paQueryParams Query parameter name/value pairs.

Methods

See Methods.

Name Purpose
ClearData Clears parsed URI fields.
ParseURI Parses a URI string into component properties.
SetQueryParam Sets or replaces a query parameter value.
QueryParam Returns a query parameter value by name.
QueryAsStringEncoded Returns the encoded query string.
PathAsString Returns path segments as a slash-delimited path.
PathAsStringEncoded Returns path segments as an encoded slash-delimited path.
GenerateURI Generates a URI from current component properties.

Example

Handle hoParser
String sUri
Get Create (RefClass(cURIParser)) to hoParser
Send ParseURI of hoParser "https://example.com/orders?page=1"
Send SetQueryParam of hoParser "page" "2"
Get GenerateURI of hoParser to sUri
Send Destroy of hoParser

See also