---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/api-reference

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# UriMatcherResponse - Scoped

# UriMatcherResponse - Scoped {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 Minuten Lesedauer

Provides methods to return information about whether a URI matches specified criteria for scheme, host, path, fragments, and presence of query parameters.

Use this API with the UriMatcher API. This API doesn't have a constructor. Instead, use the [UriMatcher - match()](https://servicenow-prod.fluidtopics.net/n8WO2kgRoib7SFH~n6Uccg#UriMatcher-match_S_S_O_O_O_B "Checks if a URI matches specified criteria for scheme, host, path, fragments, and presence of query parameters.") method to instantiate a UriMatcherResponse object.

The UriMatcherResponse API requires the REST API Provider (com.glide.rest) plugin, which is activated by default.

This API is provided within the `sn_ws` namespace.

## UriMatcherResponse - getErrorMessages() {#ariaid-title2}

Returns messages about any errors that occurred when testing the URI against the specified criteria.
{#UriMatcherResp-getErrorMessages__table_ymw_1zt_rdc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 1. Parameters]

{#UriMatcherResp-getErrorMessages__table_ymw_1zt_rdc} {#UriMatcherResp-getErrorMessages__table_zmw_1zt_rdc__entry__2}

| Type | Description |
|-|-|
| String | Description of the error that occurred. If no error occurred, an empty string is returned. |
[Tabelle : 2. Returns]

{#UriMatcherResp-getErrorMessages__table_zmw_1zt_rdc}  
This example returns an error because a host wasn't provided in the matching criteria.

    var uri = "https://example.com";
    var scheme = "https";    
    var matcher = new sn_ws.UriMatcher();  
    var resp = matcher.match(uri, scheme);  

    gs.info("Error occurred: " + resp.isError());  
    gs.info("Error message: " + resp.getErrorMessages());

Output:

    Error occurred: true
    Error message: Hosts rule is null or empty.

## UriMatcherResponse - isError() {#ariaid-title3}

Checks if an error occurred when testing the URI against the specified criteria.
{#UriMatcherResp-isError__table_mh3_xyt_rdc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 3. Parameters]

{#UriMatcherResp-isError__table_mh3_xyt_rdc} {#UriMatcherResp-isError__table_nh3_xyt_rdc__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether an error occurred. Valid values: * true: An error occurred. * false: No errors occurred. {#UriMatcherResp-isError__ul_wxh_2t4_sdc} |
[Tabelle : 4. Returns]

{#UriMatcherResp-isError__table_nh3_xyt_rdc}  
This example returns an error because the URI contains query parameters. The error occurs because the argument passed to match() for disallowQueryParameters is `true`.

    var uri = "https://example.com/path1/more?q=query";
    var scheme = "https";  
    var allowedHosts = ["example.com", "sample.com"];  
    var allowedPaths = ["/path1/more", "/path2/less"];  
    var allowedFragments = ["section1", "section2"];  
    var noQueryParams = true;
    var matcher = new sn_ws.UriMatcher();  
    var resp = matcher.match(uri, scheme, allowedHosts, allowedPaths, allowedFragments, noQueryParams);  

    gs.info("Error occurred: " + resp.isError());  
    gs.info("Error message: " + resp.getErrorMessages());

Output:

    Error occurred: true
    Error message: Query parameters are not allowed for matching.

## UriMatcherResponse - isFragmentMatches() {#ariaid-title4}

Checks if the URI matches the criteria for fragments.
{#UriMatcherResp-isFragmentMatches__table_vls_lzt_rdc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 5. Parameters]

{#UriMatcherResp-isFragmentMatches__table_vls_lzt_rdc} {#UriMatcherResp-isFragmentMatches__table_wls_lzt_rdc__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the URI matches the criteria for fragments. Valid values: * true: The URI matches the criteria for fragments. * false: The URI doesn't match the criteria for fragments. {#UriMatcherResp-isFragmentMatches__ul_mgr_ckp_sdc} |
[Tabelle : 6. Returns]

{#UriMatcherResp-isFragmentMatches__table_wls_lzt_rdc}  
This example shows that the URI doesn't match the criteria because it contains a fragment that isn't in the list of allowed fragments.

    var uri = "https://example.com/path1/more#section3";
    var scheme = "https";  
    var allowedHosts = ["example.com", "sample.com"];  
    var allowedPaths = ["/path1/more", "/path2/less"];  
    var allowedFragments = ["section1", "section2"];  
    var matcher = new sn_ws.UriMatcher();  
    var resp = matcher.match(uri, scheme, allowedHosts, allowedPaths, allowedFragments);  

    gs.info("Is URI a match: " + resp.isMatch());  
    gs.info("Is scheme a match: " + resp.isSchemeMatches());  
    gs.info("Is host a match: " + resp.isHostMatches());  
    gs.info("Is path a match: " + resp.isPathMatches());  
    gs.info("Is fragment a match: " + resp.isFragmentMatches());
    gs.info("Error occurred: " + resp.isError());

Output:

    Is URI a match: false
    Is scheme a match: true
    Is host a match: true
    Is path a match: true
    Is fragment a match: false
    Error occurred: false

## UriMatcherResponse - isHostMatches() {#ariaid-title5}

Checks if the URI matches the criteria for the host.
{#UriMatcherResp-isHostMatches__table_igl_hzt_rdc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 7. Parameters]

{#UriMatcherResp-isHostMatches__table_igl_hzt_rdc} {#UriMatcherResp-isHostMatches__table_jgl_hzt_rdc__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the URI matches the criteria for the host. Valid values: * true: The URI matches the criteria for the host. * false: The URI doesn't match the criteria for the host. {#UriMatcherResp-isHostMatches__ul_dks_slp_sdc} |
[Tabelle : 8. Returns]

{#UriMatcherResp-isHostMatches__table_jgl_hzt_rdc}  
This example checks if the URI matches the specified scheme and host.

    var uri = "https://example.com/path?q=query";
    var scheme = "https";  
    var allowedHosts = ["example.com"];  
    var matcher = new sn_ws.UriMatcher();  
    var resp = matcher.match(uri, scheme, allowedHosts);  

    gs.info("Is URI a match: " + resp.isMatch());
    gs.info("Is host a match: " + resp.isHostMatches());

Output:

    Is URI a match: true
    Is host a match: true

## UriMatcherResponse - isMatch() {#ariaid-title6}

Checks if the URI matches all of the specified criteria.
{#UriMatcherResp-isMatch__table_gzs_tyt_rdc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 9. Parameters]

{#UriMatcherResp-isMatch__table_gzs_tyt_rdc} {#UriMatcherResp-isMatch__table_hzs_tyt_rdc__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the URI matches all of the specified criteria. Valid values: * true: The URI matches all of the criteria. * false: The URI doesn't match all of the criteria. {#UriMatcherResp-isMatch__ul_dks_slp_sdc} |
[Tabelle : 10. Returns]

{#UriMatcherResp-isMatch__table_hzs_tyt_rdc}  
This example checks if the URI matches the specified scheme and host.

    var uri = "https://example.com/path?q=query";
    var scheme = "https";  
    var allowedHosts = ["example.com"];  
    var matcher = new sn_ws.UriMatcher();  
    var resp = matcher.match(uri, scheme, allowedHosts);  

    gs.info("Is URI a match: " + resp.isMatch());

Output:

    Is URI a match: true

## UriMatcherResponse - isPathMatches() {#ariaid-title7}

Checks if the URI matches the criteria for the path.
{#UriMatcherResp-isPathMatches__table_a5x_3zt_rdc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 11. Parameters]

{#UriMatcherResp-isPathMatches__table_a5x_3zt_rdc} {#UriMatcherResp-isPathMatches__table_b5x_3zt_rdc__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the URI matches the criteria for the path. Valid values: * true: The URI matches the criteria for the path. * false: The URI doesn't match the criteria for the path. {#UriMatcherResp-isPathMatches__ul_dks_slp_sdc} |
[Tabelle : 12. Returns]

{#UriMatcherResp-isPathMatches__table_b5x_3zt_rdc}  
This example checks if the URI matches the specified scheme, host, and path.

    var uri = "https://example.com/path1/more";
    var scheme = "https";  
    var allowedHosts = ["example.com", "sample.com"];  
    var allowedPaths = ["/path1/more", "/path2/less"];  
    var matcher = new sn_ws.UriMatcher();  
    var resp = matcher.match(uri, scheme, allowedHosts, allowedPaths);  

    gs.info("Is URI a match: " + resp.isMatch());  
    gs.info("Is scheme a match: " + resp.isSchemeMatches());  
    gs.info("Is host a match: " + resp.isHostMatches());  
    gs.info("Is path a match: " + resp.isPathMatches());  
    gs.info("Is fragment a match: " + resp.isFragmentMatches());
    gs.info("Error occurred: " + resp.isError());

Output:

    Is URI a match: true
    Is scheme a match: true
    Is host a match: true
    Is path a match: true
    Is fragment a match: true
    Error occurred: false

## UriMatcherResponse - isSchemeMatches() {#ariaid-title8}

Checks if the URI matches the criteria for the scheme.
{#UriMatcherResp-isSchemeMatches__table_p54_dzt_rdc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 13. Parameters]

{#UriMatcherResp-isSchemeMatches__table_p54_dzt_rdc} {#UriMatcherResp-isSchemeMatches__table_q54_dzt_rdc__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether the URI matches the criteria for the scheme. Valid values: * true: The URI matches the criteria for the scheme. * false: The URI doesn't match the criteria for the scheme. {#UriMatcherResp-isSchemeMatches__ul_dks_slp_sdc} |
[Tabelle : 14. Returns]

{#UriMatcherResp-isSchemeMatches__table_q54_dzt_rdc}  
This example checks if the URI matches the specified scheme and host.

    var uri = "https://example.com/path?q=query";
    var scheme = "https";  
    var allowedHosts = ["example.com"];  
    var matcher = new sn_ws.UriMatcher();  
    var resp = matcher.match(uri, scheme, allowedHosts);  

    gs.info("Is URI a match: " + resp.isMatch());
    gs.info("Is scheme a match: " + resp.isSchemeMatches());

Output:

    Is URI a match: true
    Is scheme a match: true


