Multipart data
When sending an HTTP request, Semarchy xDI can send data as an HTTP multipart request. Each part of the request is content defined with a valid content type.
Configure your metadata
To send messages in a multipart HTTP request, you must add all of them to a request body, under a special node.
-
In the metadata editor, find an operation node to which you want to add multipart content.
-
If a Request Body node does not exist already, open the context menu on the operation node, and select New > Request Body to create it.
-
Open the context menu on the Request Body node, and select New > Multipart. A multipart container node appears.
-
Open the content menu on the Multipart node, and select New > Part. A part node appears.
-
Create other part nodes as needed.
-
For each part node, open its context menu, and select New > Content. A content node appears.
You can create as many part nodes as you want, each with their set of content.
![howto multipart metadata](../../_images/http-rest/howto-multipart-metadata.webp)
Configure your mapping
In a mapping, you do not need to map anything to the higher-level Multipart node. Instead, map datastores to its nested individual Content nodes.
Create or open a mapping. Add HTTP REST metadata to your mapping, and unfold the HTTP method until you see the multipart content node. Unroll this node until you see the individual content nodes.
Map your datastores to and from the content fields, and their nested elements if applicable.
![howto multipart mapping](../../_images/http-rest/howto-multipart-mapping.webp)