urlUtils

require(["esri/core/urlUtils"], function(urlUtils) { /* code goes here */ });
Object: esri/core/urlUtils
Since: ArcGIS API for JavaScript 4.0

Utility methods for working with URLs.

Method Overview

NameReturn TypeSummary
Number

Adds the given proxy rule to the proxy rules list: esriConfig.request.proxyRules.

more details
more details
Object

Returns the proxy rule that matches the given URL.

more details
more details
Object

Converts the URL arguments to an object representation.

more details
more details

Method Details

addProxyRule(rule){Number}static

Adds the given proxy rule to the proxy rules list: esriConfig.request.proxyRules.

Parameters:
rule Object

An object specifying a URL that should use the proxy. See the object specification table below for the required properties of this object.

Specification:
proxyUrl String

The URL of the proxy.

urlPrefix String

The URL prefix of the resources that should be accessed through the given proxy.

Returns:
TypeDescription
NumberThe index of the proxy rule in the esriConfig.request.proxyRules array.
See also:

getProxyRule(url){Object}static

Returns the proxy rule that matches the given URL.

Parameter:
url String

The URL of the resources accessed via proxy.

Returns:
TypeDescription
ObjectThe proxy rule object as defined in esriConfig.request.proxyRules.
See also:

urlToObject(url){Object}static

Converts the URL arguments to an object representation.

Parameter:
url String

The input URL.

Returns:
TypeDescription
ObjectReturns an object representing the URL, its parameters, and parameter values. The specification of the object is the following:
PropertyTypeDescription
pathStringThe path of the given URL.
queryObjectAn object whose properties and values are the parameters and parameter values of the given URL.
Example:
var myObject = urlUtils.urlToObject("http://www.myworld.com?state_name=Ohio&city_name=Akron");
  // The value of my Object is...
  // { path: "http://www.myworld.com", query: {state_name: "Ohio", city_name: "Akron"} }

API Reference search results

NameTypeModule

There were no match results from your search criteria.