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:
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.
Open Anypointstudio >> Open New Project
Name it as per the requirement and then drag HTTP connector from the palette and configure it.
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
The output looks like is in the below.
And the console output looks
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 email@example.com.