下面是正在起作用的卷发
curl -v --user-agent "curl" --header "Authorization:NCC token=<>" --header "Content-Type:multipart/form-data" -H "Transfer-Encoding: chunked" -F "mount_id=123" -F "file_name=Tesr.pdf" -F "checksum=5e46d3582b541fbd52eb22064f7957ef" -F chunk="@Test.pdf" https://www.ncryptedcloud.com/api/3.0/uploads/46dde6c4-831a-4eda-b172-b20df1bc9ef9/0-/
下面是我正在使用的Mule设置
<set-attachment attachmentName="#['file_name']" value="#[flowVars.OriginalPayload.fileName]" contentType="text/plain" doc:name="Attachment"/>
<set-attachment attachmentName="#['checksum']" value="#[flowVars.Chksum]" contentType="text/plain" doc:name="Attachment"/>
<set-payload value="#[new java.io.File(flowVars.OriginalPayload.fileLocation,flowVars.OriginalPayload.fileName);]" doc:name="Set Payload"/>
<object-to-byte-array-transformer doc:name="Object to Byte Array"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<set-attachment attachmentName="chunk" value="#[payload]" contentType="application/pdf" doc:name="Attachment"/>
<set-property propertyName="Content-Type" value="multipart/form-data" doc:name="Property"/>
<set-payload value="#[null]" doc:name="Set Payload"/>
<http:request config-ref="HTTP_Request_Configuration" path="api/3.0/uploads/69f0b2fc-3f2c-4369-9444-5b0cb54abd50/0-/" method="POST" doc:name="Copy_of_HTTP" sendBodyMode="ALWAYS">
<http:request-builder>
<http:header headerName="Authorization" value="NCC token=eyJ0eXAiOiAiTkNDIn0.eyJ2IjogIlZtN1BrU0xTN2c2QSJ9"/>
<http:header headerName="Content-Type" value="multipart/form-data; boundary=----WebKitFormBoundaryzuW5nPZQFQCwQtg4"/>
<http:header headerName="Transfer-Encoding" value="chunked"/>
</http:request-builder>
</http:request>
我收到400响应和一条消息,内容为“ {“ non_field_errors”:[“收到损坏的数据”]}“。