Skip to main content

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?

Good day SindhuKodikal


 


Please see the following.


REST: https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#ServiceBrokers/EndPoints/REST_Endpoint.htm%3FTocPath%3DAdminister%7CK2%2520Management%7CIntegration%7CService%2520Types%7CGeneric%252FEndPoints%2520Service%2520Types%7CREST%7C_____0,


REST Swagger File Reference Format: https://help.k2.com/onlinehelp/k2five/userguide/5.3/default.htm#ServiceBrokers/EndPoints/REST_SwaggerFileReferenceFormat.htm%3FTocPath%3DAdminister%7CK2%2520Management%7CIntegration%7CService%2520Types%7CGeneric%252FEndPoints%2520Service%2520Types%7CREST%7C_____1.


 


Best,


Sunrise


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.


Reply