1
votes

How do I get request form-data as a string in API Connect? I tried to get it in Gateway script by different ways, like apim.getvariable('request.body') or session.input.readAsBuffer, but everything was unsuccessful. I have two attachments in form-data and I would like to split it in my script.

At the moment I haven't found any documentation about processing form-data in IBM API Connect.

1

1 Answers

1
votes

If you are using a POST QueryString you can decode the URI component in your Gateway script using:

var myQueryString = decodeURIComponent(apim.getvariable('request.body').item(0).toBuffer().toString())