Java 如何在mulesoft中使用内容类型为multipart/form数据的HTTP连接器上载文件

Java 如何在mulesoft中使用内容类型为multipart/form数据的HTTP连接器上载文件,java,mule,anypoint-studio,Java,Mule,Anypoint Studio,我正在尝试使用mule在Jira中上传一个文件(多部分/表单数据)。我得到了200作为状态,但它给出了空响应,没有文件上传到Jira。文件内容在缓冲的inputstream中 <set-attachment attachmentName="#[flowVars.filename]" value="#[payload]" contentType="text/plain" doc:name="Attachment" metadata:id="2d991254-c66e-4861-b099-e

我正在尝试使用mule在Jira中上传一个文件(多部分/表单数据)。我得到了200作为状态,但它给出了空响应,没有文件上传到Jira。文件内容在缓冲的inputstream中

 <set-attachment attachmentName="#[flowVars.filename]" value="#[payload]" contentType="text/plain" doc:name="Attachment" metadata:id="2d991254-c66e-4861-b099-eb624ea4a018"/>
    <http:request config-ref="HTTP_Request_Configuration" path="/rest/api/2/issue/JIR-2/attachments" method="POST" doc:name="HTTP">
        <http:request-builder>
            <http:query-param paramName="oauth_nonce" value="#[flowVars.para.oauth_nonce]"/>
            <http:query-param paramName="oauth_token" value="#[flowVars.para.oauth_token]"/>
            <http:query-param paramName="oauth_timestamp" value="#[flowVars.para.oauth_timestamp]"/>
            <http:query-param paramName="oauth_signature_method" value="RSA-SHA1"/>
            <http:query-param paramName="oauth_consumer_key" value="hardcoded-consumer"/>
            <http:query-param paramName="oauth_version" value="1.0"/>
            <http:query-param paramName="oauth_signature" value="#[flowVars.para.oauth_signature]"/>
            <http:header headerName="X-Atlassian-Token" value="nocheck"/>
            <http:header headerName="Content-Type" value="multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"/>
            <http:header headerName="------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition" value="form-data; name=&quot;documentFile&quot;; filename=&quot;documentFile&quot;"/>
        </http:request-builder>
    </http:request>

每当您使用HTTP处理文件时,最好的选择是“mule requester”,您可以使用它在mule流的中间调用文件。因此,请尝试为您的问题提供排序方法