HOW to Create Deployment from string(xml content) with REST API

Hello everyone , i am new to Camunda .
i want to know if there a way to Create Deployment from string with REST API ( POST /deployment/create) ?
I saw that there always upload a .bpmn file in those examples 。
thanks。

Hi, what is the motivation / usage scenario for your question?

The appropriate way to transfer a large String (as a bpmn file can potentially be) and its meta data is a multi-part form. https://tools.ietf.org/html/rfc7578

If you absolutely wanted to work with a String then you could just write the String to a httpRequestBodyWriter as described here:

Thanks for your reply .
I want to Integrate Oracle apex with camunda use REST API .
I use bpmn-js as my web modeler to design workflow .
I want to allow specified users to design and deployment process by themself .
Do you have any suggestions ?
Thank you .

below will be work . thanks alot @rob2universe

var settings = {
“url”: “http://192.168.56.135:8081/engine-rest/deployment/create”,
“method”: “POST”,
“timeout”: 0,
“headers”: {
“Content-Type”: “multipart/form-data; boundary=gc0p4Jq0M2Yt08jU534c0p678”
},
“data”: “–gc0p4Jq0M2Yt08jU534c0p678\r\nContent-Disposition: form-data; name="deployment-name"\r\n\r\ndepname\r\n–gc0p4Jq0M2Yt08jU534c0p678\r\nContent-Disposition: form-data; name="data";filename="ps1.bpmn"\r\n\r\n**{here is bpmn xml contents }**\r\n–gc0p4Jq0M2Yt08jU534c0p678–”,
};

$.ajax(settings).done(function (response) {
console.log(response);
});

the docs Post Deployment | docs.camunda.org is right , but i didn’t understand it clearly before .