Add query and path parameters to the URI
- Last Updated: February 11, 2026
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
The OpenEdge.Net.URI class enables you to
create HTTP URIs. The URI class constructor is
overloaded, so there are a number of different parameters that you can pass. Typically
though, you want to pass the following parameters:
- The scheme (http or https)
- The hostname or sitename
- Optionally, a port number
The following example defines a base URI:
|
Path property:
|
Alternatively, you can use the Parse()
method to turn a string into a URI object:
|
Add query strings
A query string is a set of one or more parameters that, when passed to a REST API, filters the dataset returned by the API.For example,
to get records for customers in Finland, your URI path must include the parameter
country=Finland in a query
string:
|
? in the URI path indicates that a
query string follows. Multiple queries can be passed using the & separator. For example, to select customers from Finland, who have
'DKP' as their sales representative, you would need a URI like this:
|
- Add a query string (using the
AddQueryString()method). Use this option if you have a string comprising all the query parameters.
TheoURI:AddQueryString("filter=Country='Finland'", false).AddQueryString()method takes two parameters—the query string, which is a character string, and a logical (true or false) value that indicates whether the query string should be URL decoded1. - Add one or more queries by calling
AddQuery()for each parameter. Use this option if you have many queries, some of which are populated by variable values.oURI:AddQuery("filter", "'Country=Finland'"). oURI:AddQuery("SalesRep", "DKP").
Add path parameters
A path parameter is separated by slashes (/) in the URI. Unlike a query, which requires a key-value pair (Country=Finland), a path parameter requires only a value.
The following is an example of a customer ID (1) being
passed as a path parameter in the URI:
|
AddPathSegment():
|
API reference documentation
To view the complete list of methods that you can use on a URI object, refer to the OpenEdge.Net.URI documentation or see the OpenEdge.Net API Reference documentation.1 URLs are encoded as per the IETF specification.
URL decoding replaces '%' escape characters in the URL, if any
exist.