How do I force the HTTP Request Connector to use a

2019-08-22 03:28发布

In Mule 3.6, I have the following HTTP Request Connector:

<http:request config-ref="IPAM_Request_Config" path="${ipam.path}" method="POST" doc:name="Send SMS to IPAM">
    <http:request-builder>
        <http:query-param paramName="mobile" value="sms.mobile"/>
        <http:query-param paramName="textmsg" value="sms.text"/>
        <http:query-param paramName="receiver" value="sms.receiver"/>
        <http:query-param paramName="mobileoperator" value="sms.operator"/>
        <http:query-param paramName="circle" value="sms.circle"/>
        <http:query-param paramName="time" value="sms.time"/>
    </http:request-builder>
</http:request>

How do I force this to take the Content-Type as application/x-www-form-urlencoded. It is taking text/plain;charset=windows-1252 even though the payload is a org.mule.module.http.internal.ParameterMap.

标签: java http mule
2条回答
看我几分像从前
2楼-- · 2019-08-22 04:16

You can also set this within the http:request-builder with the following:

<http:request-builder>
    <http:query-param paramName="mobile" value="sms.mobile"/>
    ... other params ....
    <http:header headerName="Content-Type" value="application/x-www-form-urlencoded"/>
</http:request-builder>
查看更多
姐就是有狂的资本
3楼-- · 2019-08-22 04:31

Set the Content-Type manually before the request:

<set-property propertyName="Content-Type" value="application/x-www-form-urlencoded" />
查看更多
登录 后发表回答