Right now my POST looks like this
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="guideContainerPath" /content/forms/af/submittest/jcr:content/guideContainer
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="aemFormComponentPath"
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_asyncSubmit" false
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_charset_" UTF-8
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="runtimeLocale"< en
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="fileAttachmentMap" {}
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="afSubmissionInfo" {"computedMetaInfo":{},"signers":{}}
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="name" John Doe
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="jcr:data" <?xml version="1.0" encoding="UTF-8"?>
<afData><afUnboundData><data><name>John Doe</name></data></afUnboundData><afBoundData><data xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"/></afBoundData><afSubmissionInfo><computedMetaInfo/><signers/><afPath>/content/dam/formsanddocuments/submittest</afPath><afSubmissionTime>20200116013642</afSubmissionTime></afSubmissionInfo></afData>
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="jcr:data@TypeHint" Binary
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name=":redirect" /content/forms/af/submittest/jcr:content/guideContainer.guideThankYouPage.html
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name=":selfUrl" /content/forms/af/submittest
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_guideValueMap" yes
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_guideValuesMap" {"name":"John Doe","button1579175911492":null,"reset":null,"saveGuideDraft":null,"submit":null}
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name="_guideAttachments"
------WebKitFormBoundarypl5WMcXXSIhKex0X
Content-Disposition: form-data; name=":cq_csrf_token" eyJleHAiOjE1NzkxNzk3MDMsImlhdCI6MTU3OTE3OTEwM30.fOaF2_mbWw-Q8-mZJwJXxfJPZPi8xYVDcsmKW2ne-s4
------WebKitFormBoundarypl5WMcXXSIhKex0X--
The problem is that I don't know where to programmatically write what I want to send. Normally I would write an XMLHttpRequest in the button in javascript and grab the XML data and the PDF and send it. Now I don't know how I send the DOR (the filled in web form as a PDF).