Skip to main content
Nintex Community Menu Bar

How to consume a multipart/formdata post method from swagger 2.0 in K2 Five?

  • March 10, 2020
  • 2 replies
  • 144 views

Hi
I have a post method which consumed multipart/formdata. I have created advanced smart object to consume this method, added the headers. When I execute this smo, I found that k2 sends it as application/x-www-form-urlencoded rather than multipart/formdata.

Can you let me know if K2 sends by default as application/x-www-form-urlencoded? If yes, then how can we convert to multipart/formdata from K2 five?

2 replies

  • March 11, 2020

I have the swagger where I have defined the method name as below:

"/methodname": {
"post": {
"consumes": [
"multipart/form-data"
]

 

The parameter is defined as:

{
"in": "formData",
"name": "xxx",
"type": "string",
"required": true,
}

 

Also in the Header of the SMO, I am sending the Content-Type: multipart/form-data. 

 

Inspite of this, we can see that the service provider which we are consuming is receiving the service as x-www-form-urlencoded. We are not sure where K2 is converting to this format.