Multipart request messages
- Last Updated: February 11, 2026
- 4 minute read
- OpenEdge
- Version 13.0
- Documentation
A multipart message contains a body with many component body parts. Each body part has a content type, a body, and headers (which are optional). Multipart messages are typically used in order to avoid multiple request/responses, or to provide different representations of the same data.
The OpenEdge.Net library supports the
transmission of multipart messages through the OpenEdge.Net.MultipartEntity and the OpenEdge.Net.MessagePart classes.
To create a request body consisting of multiple parts, create multiple MessagePart objects, add them to a MultipartEntity object, and pass the MultipartEntity as the request body.
MessagePart can have two parameters—the
content type (string) and an object. The object can be string/longchar, a string or JSON
object, or a binary file (for example, a ByteBucket).base64 encoded for transfer. If all parts of the message are
strings then they will remain as such and will not be encoded during the tranmission
and subsequent reading of the request.
|
test-image.jpg referenced in the third
message part of the sample code can be any *.jpeg image located in the
PROPATH for the code when executed. The following code illustrates how a WebHandler instance will look like after accepting a multipart request from an HttpClient application.
|