Cannot capture contentStream from Postman with content-type: multipart/form-data

Product/components used and version/fix level:

Integration Server 10.15 with no fixes

Detailed explanation of the problem:

I’m trying to receive request from POSTMAN with content-type: multipart/form-data and in body type of form-data with file attached.
I want to capture the file in contentStream variable.

Error messages / full error message screenshot / log file:

I don’t see contentStream value when doing a restorePipeline.

You won’t see contentStream, nor any stream, from a pipeline save. Those object types are not serializable. You’ll need to read the streams first. Read them to byte array, string, whatever. For a multi-part form with attachments, you’ll need to use the MIME services to process the parts. For a file attachment, you’ll want to take care to not try to load the entire content into memory if it is large.

2 Likes

If you are using savePipelineToFile, paired with restorePipelineFromFile, then it wont show up because, as @reamon mentioned, only serializable objects show up. But if you are using savePipeline, combined with restorePipeline, then all variables in the pipeline should show up.

Rupinder Singh

1 Like

The variable might be there but it won’t be usable. A contentStream is an object to manage access to the bits on the wire. The object does not contain the bytes that would be read. And the handle/socket/network connection that the stream is providing access to will be gone.

Streams are usable as long as the underlying bytes are available too. For example, if a stream is used to read a byte array and that byte array is in memory (in another variable) the stream object may be usable, depending upon how far the read from the stream has proceeded, the possible use of mark and reset, etc. But for data via network it will not be usable after the network data has been read and the connection closed.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.