Skip to content

qie.parseMultipart

Signature: qie.parseMultipart(multipart)

Returns: Map<String, String> multipartMap - a Java Map<String,String> instance containing the separated multipart content

Parse the multipart content into a Java Map<String, String> instance that contains the multipart content in separate elements (i.e. 'Content-Type[1]'=the content type of part 1, 'Content[1]'=the content of part 1, etc.).

Parameters

Type Name Description Default
String multipart the multipart content to parse

Example

var multipartContent = `
--boundary123
Content-Disposition: form-data; name="field1"

value1
--boundary123
Content-Disposition: form-data; name="field2"; filename="example.txt"
Content-Type: text/plain

This is the content of the file.
--boundary123--
`;
var parameterMap = qie.parseMultipart(multipartContent);
var keySet = parameterMap.keySet();
var content2Chunk = parameterMap.get('Content[2]');