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

Retrieve URI Parameters from HTTP URL in Mule 4

 

Trigger the request from soap ui

Retrieve URI Parameters from HTTP URL in Mule 4

 

Sample application: retrieveuriparams sample application

 

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments