How to use parseURI in Dataweave to get URL data

parseURI can be used to fetch the information of the URL. The information can be like host, path, query parameters, a protocol used, etc

There could be some requirement where we need to route the data or use the information from the URL for transformations. parseURI function which is part of dw::core::URL module can be used in such scenarios.



Possible search terms:

How to extract URL information using Dataweave in Mulesoft

How to get URL info with Dataweave in Mule

How to use parseURI in Dataweave to get information from URL

Dataweave code:
%dw 2.0
import * from dw::core::URL
output application/json
---
{
'URLInfo-1': parseURI('https://mulesoft.designgrows.com/admin/file.js?page=_script'),
'URLInfo-2': parseURI('http://www.w3.org/2004/02/skos/core#broader')

}




 

Also read: How to Create local variables in Dataweave with using operator





Post a Comment

0 Comments