How to add form-data in POST Request

0
Hi all, I am trying to send “form-data” in a POST Request via Mendix (e.g. name = MyName). I achieve the desired result with Postman. In Mendix I try to achieve this in a Microflow with a “CALL REST (POST)” action and by Adding a HTTP Header with Key “Content-Type” and Value “'application/form-data'” (of course w/o the “) and by adding the following in the tab “Request”: “name=myName”   Unfortunately that does not work out. Any ideas?   Thanks and best regards, Tobias        
asked
2 answers
3

Hi Tobias,

This is the correct approach so I am not sure why it is not working. Can you be more specific what happens? Maybe you can post your error message. You can also check the following things:

  • Make sure it is a post request as opposed to a get or something else (under General)
  • Try setting the header content-Type to 'application/x-www-form-urlencoded'
  • Make sure that whatever you are sending as value is safe to send in a URL by using `urlEncode`

Hope this helps,

Andrej

 

answered
2

Hi,

While using Form-Data , we can leave HTTP Headers as empty,

  1. In request tab add the File and FileName as key and value pair.
  2. You can send metadata like this as Key and Value.

In this way there is no conversion required.

Thank You

answered