Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mule HTTP POST`form data`到映射的转换_Http_Http Post_Mule - Fatal编程技术网

Mule HTTP POST`form data`到映射的转换

Mule HTTP POST`form data`到映射的转换,http,http-post,mule,Http,Http Post,Mule,我的mule应用程序正在接收一个HTTP POST请求,其内容类型为多部分/表单数据。我尝试使用自定义转换器,但不知道如何访问参数,因为对象属于类contentLengthinInputStream 如何访问表单参数 我想把参数转换成地图。我该怎么做 例如,可以在流中使用#[message.inboundAttachments[payload]发送http出站端点: <message-properties-transformer doc:name="Message"> <

我的mule应用程序正在接收一个HTTP POST请求,其内容类型为
多部分/表单数据
。我尝试使用自定义转换器,但不知道如何访问参数,因为对象属于类
contentLengthinInputStream

  • 如何访问表单参数
  • 我想把参数转换成地图。我该怎么做
  • 例如,可以在流中使用#[message.inboundAttachments[payload]发送http出站端点:

    <message-properties-transformer doc:name="Message">
        <add-message-property key="Content-type" value="multipart/form-data/>
    </message-properties-transformer>
    <http:outbound-endpoint exchange-pattern="request-response" method="POST" doc:name="HTTP" address="http://localhost:9090" mimeType="multipart/form-data"/>
    

    我无法访问这样的表单参数。它们不是以
    InboundAttachment
    s的形式出现的。我得到了
    null
    值。我的客户端添加了
    应用程序/xml
    头。这就是我得到错误的原因。现在已修复。谢谢。
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8090" connector-ref="HTTP_HTTPS" doc:name="HTTP" contentType="multipart/form-data"/>
    <logger message="#[message.inboundAttachments[payload]]" level="ERROR" doc:name="Logger"/>
    
    DataHandler inboundAttachment = message.getInboundAttachment("AttachmentName");