如何从wso2 ESB中的Response消息中删除Content-Type

问题描述 投票:0回答:1

我在wso2 ESB中有一个api。我的API是这样的:

<inSequense>
   <send>
     <Endpint key="exapleEndpint">
   </send>
</inSequence>
<outSequence>
      <header action="remove" name="Content-Type" scope="transport"/>
      <send/>
<outSequence>

我用卷曲打电话给我的api:

curl -i -X POST http://192.168.0.1:8280/login -F action=mobile -F user_username=3324 -F user_password=111111  -H "Accept:application/json"

当我打电话时,我在响应消息中看到Content-Type标题。如何删除此标头。我想删除Content-type并添加我的Content-type和parse响应。 exmapleEndpint返回json体但在头文件中返回Content-Type:text / html;字符集= UTF-8。谢谢

header wso2esb content-type
1个回答
1
投票

尝试在发送之前删除此属性,在outSequence:<property name="Content-Type" scope="transport" action="remove"/>

但如果您的目标是将内容类型更改为application / json,只需说wso2即可使用相应的消息Formater:<property name="messageType" scope="axis2" value="application/json"/>

© www.soinside.com 2019 - 2024. All rights reserved.