Help to send file to API with EasyMorph

I must send a file to an API. I have a postman that works. Postman show code that is used:

curl --location --request POST 'urlapi/imports'
--header 'Authorization: token'
--header 'Accept: application/json'
--header 'Content-Type: multipart/form-data'
--form 'file=""sku";"quantity"
"02200",7.00
"04748",2.00"'
--form 'import_mode="NORMAL"'

I don't see how to create this request with EasyMorph.
I get error like this:

Unsupported Media Type. 415

Can you help me ?

Can you please also post a screenshot of the "Headers" tab?

image

You're doing a file upload in this request. Use a different mode - "Body is file". Also specify your additional form parameter. See below

Also, you probably need the regular "Web request" action here, not "Iterate web request", because you're performing one request, not a series of requests.

And a small addition to the text above.
In this case, you need not specify "Content-Type multipart/form-data" in the Headers tab.
If you want to specify it, you must fill in the content type of the transferred file.

I have tested this but i can't past file with multiline in parameter.

Thanks, all works.

1 Like