Skip to main content

Hello everyone,

I need to consume a rest api in which the request's body is a multipart/form-data , and in attachment it also has an image (key= "image") .

I tried to construct the body of such request:

 

%dw 2.0

output multipart/form-data

---

{"parts":

{"image":

{

"headers":{

"Content-Disposition":

{

"name": "image", 

"filename": "Rosaria-designstyle-smoothie-m.png",

"subtype": "form-data"

}, 

"Content-Type": "image/png", 

"Content-Transfer-Encoding": "binary"

},

"content": vars.image

}

}

}

 

and as result it returned the following error message:

 

"Required form parameter image not specified"

 

What element is missing in my request body?

 

Thank you

0/9000