如何强制HTTP请求连接器使用某种内容类型? [英] How do I force the HTTP Request Connector to use a certain Content-Type?

查看:128
本文介绍了如何强制HTTP请求连接器使用某种内容类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mule 3.6中,我有以下HTTP请求连接器:

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>

如何强行执行 Content-Type as application / x-www-form-urlencoded 。它是 text / plain; charset = windows-1252 ,即使有效负载是 org.mule.module.http.internal.ParameterMap

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.

推荐答案

在请求之前手动设置Content-Type:

Set the Content-Type manually before the request:

<set-property propertyName="Content-Type" value="application/x-www-form-urlencoded" />

这篇关于如何强制HTTP请求连接器使用某种内容类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆