97008 48403
+91 40-27177600

Blog

Posting data to http with content-type application/x-www-form-urlencoded in Mule ESB

single-blog

From the technical center of excellence of Massil Technologies, our technology leader Srini makes it easy to understand the complex situations you come across in Mule ESB from the experience of Massil Technologies to have countered them in their experience of working on client projects in real time. This blog addresses how to post data to HTTP with content-type application/x-www-form-urlencoded in Mule ESB. This blog is a part of series of blogs being authored and published by Massil Technologies for the benefit of the IT community globally.

Most of us know that in HTTP, there are two ways to post data:

  • Application/x-www-form-urlencoded
  • Multipart/form-data

We understand that most browsers are only able to upload the file if multipart/form-data is used. Their encoding types is used based on data size, existence of new characters, binary data existence and the need to transfer additional data.

In this article, the focus is to learn how to post data to HTTP with content type application/x-www-form-urlencoded in Mule ESB.

Step1:

Open Anypointstudio >> Open New Project

Name it as per the requirement and then drag HTTP connector from the palette and configure it.

Step2:

Now drag the Attachment component  and configure it as follows:

and then drag the Byte Array to String Transformer select the encoding to US ASCII and

MIME Type is text/plain.

and place the logger log the payload in the console. And save the project and run the project and it will Deploy now go to the POSTMAN and made the request from it is as follows

http://localhost:8081/content

The output looks like is in the below.

And the console output looks

like

And the Mule Flow is looking likes is as follows

Hope this article from Massil Technologies was useful for you. If you have any further queries on this topic, please reach out to info@massil.tech.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Get in touch with us

Scroll to top