Nav

parseURI

parseURI(String): URI

Parses an URL and returns an URI object. The isValid: Boolean property dennotes if the parse was succeed. Every field in the URI object is optional, and it will be present only if it was present in the original URL

Transform

        
     
1
2
3
4
5
6
7
%dw 2.0
import * from dw::core::URL
output application/json
---
{
  'composition': parseURI('https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#footer')
}
Output

        
     
1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "composition": {
    "isValid": true,
    "raw": "https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#footer",
    "host": "en.wikipedia.org",
    "authority": "en.wikipedia.org",
    "fragment": "footer",
    "path": "/wiki/Uniform_Resource_Identifier",
    "scheme": "https",
    "isAbsolute": true,
    "isOpaque": false
  }
}