ESM: import * as urlUtils from "@arcgis/core/core/urlUtils.js";
CDN: const urlUtils = await $arcgis.import("@arcgis/core/core/urlUtils.js");
Object: @arcgis/core/core/urlUtils
Since: ArcGIS Maps SDK for JavaScript 4.0
Utility methods for working with URLs.
Method Overview Method Details addProxyRule(rule){Number}
Adds the given proxy rule to the proxy rules list: esriConfig.request.proxyRules
.
Parameters
Specification
An object specifying a URL that should use the proxy. See the object specification table below for the required properties of this object.
Specification
The URL of the proxy.
The URL prefix of the resources that should be accessed through the given proxy.
Returns
Type Description Number The index of the proxy rule in theesriConfig.request.proxyRules
array.
Since: ArcGIS Maps SDK for JavaScript 4.33 urlUtils since 4.0, dataToArrayBuffer added at 4.33.
Converts a base64 encoded data url to an ArrayBuffer.
Returns
Since: ArcGIS Maps SDK for JavaScript 4.33 urlUtils since 4.0, dataToBlob added at 4.33.
Converts a base64 encoded data url to a Blob.
Returns
Type Description Blob | null | undefined the blob with the data url encoded as binary data. downloadBlobAsFile(blob, filename)
Since: ArcGIS Maps SDK for JavaScript 4.33 urlUtils since 4.0, downloadBlobAsFile added at 4.33.
Trigger a browser file download from a data url encoded as binary data.
Parameters
The data url to download (as binary data.
the filename.
downloadDataAsFile(dataUrl, filename)
Since: ArcGIS Maps SDK for JavaScript 4.33 urlUtils since 4.0, downloadDataAsFile added at 4.33.
Trigger a browser file download from a base64 encoded data url.
Returns the proxy rule that matches the given URL.
Parameter
The URL of the resources accessed via proxy.
Returns
Type Description Object | null | undefined The proxy rule object as defined inesriConfig.request.proxyRules
.
isDataProtocol(url){Boolean}
Since: ArcGIS Maps SDK for JavaScript 4.32 urlUtils since 4.0, isDataProtocol added at 4.32.
Tests whether a url uses the data protocol.
This will return true
if the url starts with data:
.
Returns
Type Description Boolean Returnstrue
if the url uses the data protocol, false otherwise.
isHTTPSProtocol(url){Boolean}
Since: ArcGIS Maps SDK for JavaScript 4.32 urlUtils since 4.0, isHTTPSProtocol added at 4.32.
Tests whether a url uses the https protocol.
This will return true
if the url starts with the https protocol, or if the url is protocol relative and the application is running on https.
Returns
Type Description Boolean Returnstrue
if the url uses the https protocol, false otherwise.
Converts the URL arguments to an object representation.
Returns
Type Description Object | null | undefined Returns an object representing the URL, its parameters, and parameter values. The specification of the object is the following: Property Type Description path String The path of the given URL. query Object An object whose properties and values are the parameters and parameter values of the given URL.Example
let 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"} }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4