DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Modify JSON Data in Postgres and Hibernate 6
  • Exploring JSON Schema for Form Validation in Web Components
  • Datafaker Gen: Leveraging BigQuery Sink on Google Cloud Platform
  • Flexible Data Generation With Datafaker Gen

Trending

  • The Role of Retrieval Augmented Generation (RAG) in Development of AI-Infused Enterprise Applications
  • Ensuring Configuration Consistency Across Global Data Centers
  • Grafana Loki Fundamentals and Architecture
  • How to Build Local LLM RAG Apps With Ollama, DeepSeek-R1, and SingleStore
  1. DZone
  2. Data Engineering
  3. Data
  4. Posting JSON Data to a Mule Flow

Posting JSON Data to a Mule Flow

There are only 11 steps to POSTing JSON data to a Mule flow. JSON data can be sent directly to a Mule flow. The reason for doing this is to access data from a payload.

By 
Danish Sheikh user avatar
Danish Sheikh
·
Mar. 08, 17 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
26.6K Views

Join the DZone community and get the full member experience.

Join For Free

This is an example that showcases how data in JSON format can be sent directly to a Mule flow. The JSON data can be accessed using the Mule expression language inside the flow.

We will keep the flow simple, as accessing the data from the payload is the reason for this example.

11 Steps to POSTing JSON Data to a Mule Flow

  1. Open Anypoint Studio.

  2. Create a new Mule project. Click File > New > Mule Project.

  3. Name the project JsonAccess and click Finish.

  4. Drag the HTTP Connector from the palette onto the canvas. Click HTTP connector to open the properties window as shown below:Connector Setting Initial

  5. Click + to enter the connector settings.Connector Configuration Detail

  6. Click OK. Now add POST against Method so that only POST is allowed on /.Connector Setting

  7. Drag Logger from the palette next to the HTTP connector on the canvas. Click Logger the on canvas and enter #[json:productid] as the value for the Message.logger details

  8. Save and your run project.

  9. Open Postman. Prepare the request as shown in the image below:Image titleMake sure POST is selected as the method. Under the Body tab, choose raw and change mime to JSON (application/json). The content which we willPOST is {"productid":"6","productname":"Shampoo"}.

  10. Click Send. Go back to Anypoint Studio.

  11. Under Console, we can see the logger output as 6:Image title

Conclusion

We have successfully POSTed JSON data in the request body from Postman to the Mule application!

JSON Data (computing) Flow (web browser)

Opinions expressed by DZone contributors are their own.

Related

  • Modify JSON Data in Postgres and Hibernate 6
  • Exploring JSON Schema for Form Validation in Web Components
  • Datafaker Gen: Leveraging BigQuery Sink on Google Cloud Platform
  • Flexible Data Generation With Datafaker Gen

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!