Hello.
I am looking of script example for multipart/form-data POST to service using BPM server side scripting object $.http.post().
For example, I need to post PDF file and three string parameters like (example from postman request):
POST /pdf-service HTTP/1.1
Host: localhost:6123
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Cache-Control: no-cache
Postman-Token: 8e9b3262-d886-4d1d-8e68-97341018388e
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="download.pdf"
Content-Type: application/pdf
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="json"
{
"strdocumentname": "Document name",
"iddocumentid": 111,
"catdocumenttype": "contract",
"catfunction": "Legal",
"catstatus": "In repository",
"datdateofissue": "2018-08-10",
"idowneruser": "root",
"strcomment": "Comment",
"datdocumentduedate": "2018-08-10",
"catisrcneeded": "No",
"tabinvolvedparties": [
"TEST"
],
"strdynamicbu": "Business Unit",
"cataccess": "Group",
"tabprotocol": [
{
"datdate": "2018-08-10T00:00:00.000Z",
"strauthor": "Author1",
"strdecision": "Decision",
"strcommenttab": "Coment"
},
{
"datdate": "2018-08-10T00:00:00.000Z",
"strauthor": "Author2",
"strdecision": "Decision2",
"strcommenttab": "Coment2"
}
]
}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="template_name"
MyTemplate.docx
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="watermark_name"
watermark.docx
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Is it possible at all?