Extract form data sent to webmethods

My User is sending form data consisting of different content types like application/json , application/Text,image/jpeg

Is there any way I can extract the content type only just I need (without splitting whole payload using boundary)

Like below
----------------------------643047742134196705328818
Content-Disposition: form-data; name=“Json details”
Content-Type: application/json

{
“glossary”: {
“title”: “example glossary”,
“GlossDiv”: {
“title”: “S”,
“GlossList”: {
“GlossEntry”: {
“ID”: “SGML”,
“SortAs”: “SGML”,
“GlossTerm”: “Standard Generalized Markup Language”,
“Acronym”: “SGML”,
“Abbrev”: “ISO 8879:1986”,
“GlossDef”: {
“para”: “A meta-markup language, used to create markup languages such as DocBook.”,
“GlossSeeAlso”: [“GML”, “XML”]
},
“GlossSee”: “markup”
}
}
}
}
}
----------------------------643047742134196705328818
Content-Disposition: form-data; name=“FirstName”
Content-Type: application/Text

webMethods
----------------------------643047742134196705328818–

@Sandeep_Deepala Use pub.flow:getTransport built-in service. This output structure is pub.flow:transportInfo. Field named “requestHdrs” captures all http headers in key value pair. You don’t need to operate on the payload.

Regards
Senthil

@Senthilkumar_G …In this case user is trying to send as form-Data, no core data is sent under requestHdrs.

No. Not reliably. The entire purpose of multi-part form is to be able to correctly parse the content.

so only option is to split payload based upon boundary “----------------------------643047742134196705328818” ?

Use the MIME services. Do not do this with your own custom code – no need. The boundary string can (will) change for each call.

1 Like