Mendix REST to POST a multipart/form-data

0
Hi community.   I try to call: curl -X POST "https://api.pdfrest.com/jpg" \   -H "Accept: application/json" \   -H "Content-Type: multipart/form-data" \  -H "Api-Key: *********" \  -F "file=@PATH_TO_FILE/test.pdf" \  -F "output=test" \  -F "resolution=300" \   Any clue if this can be done?   Go Make It
asked
2 answers
1

Hi Marco,

1 In a microflow Add a Call REST Service Activity:

URL: Set the URL to https://api.pdfrest.com/jpg.

HTTP Method: Set this to POST.

2. In header Section

add the following headers:

Accept: Set this to application/json.

Api-Key: Set this to your API key as a string.

3.In Request-choose form-data

In that add Key -value

Key:  file name.

Value: Set this to a FileDocument variable

Key:  output.

Value: Set this as a string with the value test.

Key:  resolution

Value: Set this to an integer with the value 300.

 

Thanks,

Arun

answered
0

Yes, multipart/form-data is supported out-of-the-box in Mendix.

answered