Contact Us 1-800-596-4880

toUri

toUri(str: String): Uri

Transforms a String value into a Uri value.

Introduced in DataWeave version 2.4.0.

Parameters

Name Description

str

The String value to transform into a Uri value.

Example

This example shows how toUri behaves.

Source

%dw 2.0
import * from dw::util::Coercions
output application/json
---
{
  toUriExample: toUri("https://www.google.com/")
}

Output

{
  "toUriExample": "https://www.google.com/"
}