[英]How do I force the HTTP Request Connector to use a certain Content-Type?
在Mule 3.6中,我具有以下HTTP請求連接器:
<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>
如何強制將Content-Type
用作application/x-www-form-urlencoded
。 即使有效載荷是org.mule.module.http.internal.ParameterMap
它也會采用text/plain;charset=windows-1252
。
在請求之前手動設置Content-Type:
<set-property propertyName="Content-Type" value="application/x-www-form-urlencoded" />
您還可以在http:request-builder中使用以下命令進行設置:
<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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.