Retrieve URI Parameters from HTTP URL in Mule 4
In this tutorial we will demonstrate how can we retrieve the URI parameters from HTTP URL In Mule 4
Create a project in anypoint studio and configure the listener to trigger the request
We have passed the empid as uri parameter as shown in below URL
localhost:8081/api/employee/123
Create the Transform message to get the uri parameter, you can also set in the variable
%dw 2.0
output application/json
—
{
“emipd”:attributes.uriParams.’empId’
}
Deploy the project in debug mode and trigger the request
We can see the screenshot below query parameters, headers, uri parameters are part of attributes
Trigger the request from soap ui
Sample application: retrieveuriparams sample application