Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

compose

compose(Array<String>, Array<String>): String

Compose is a custom interpolator used to replace URL components by the encodeURIComponent result of it.

Transform

        
     
1
2
3
4
5
%dw 2.0
import * from dw::core::URL
output application/json
---
{ 'composition': compose `encoding http://asd/$(' text to encode ')/text now` }
Output

        
     
1
2
3
{
  "composition": "encoding http://asd/%20text%20to%20encode%20/text now"
}