[Video] Posting Form-data Content to an External API in Kumologica
We will see how an application/x-www-form-urlencoded based form-data content type is configured to invoke an external service using HTTP requestor node in Kumologica.
Join the DZone community and get the full member experience.Join For Free
Form-data content is a pretty popular form of the content type used in HTTP-based endpoints or APIs. In this article we will be specifically seeing how an
application/x-www-form-urlencoded based form-data content type is configured to invoke an external service using HTTP requestor node in Kumologica.
There are two popular form-data content types used in enterprises.
application/x-www-form-urlencoded content-type describes form data that is sent in a single block in the HTTP message body.
This content type is inefficient for sending large binary data or text containing non-ASCII characters and does not allow you to upload files. For these purposes, we can send data as
Posting Form Data in Kumologica
In order to post form-data content, we will be using the HTTP requestor node in Kumologica. We will be invoking the following endpoint for this demo. http://httpbin.org/anything.
The above endpoint will respond with all the data that has been sent to the server. This includes the header, payload, form data, attachments, etc. Using this endpoint we will know whether the form data posted from Kumologica flow was received by the server or not.
1. Drag and drop event listener node from the pallet and configure the following:
2. Place the HTTP request node on the canvas and wire it to the event listener node. Configure the following:
3. Finally, drag and drop event listener end node to the canvas. Wire it with the HTTP requestor node and configure the following.
Opinions expressed by DZone contributors are their own.