无法将Content-Type更改为"application/json; charset = UTF-8"
我正在使用带网关脚本的IBM API connect将content type
更改为"application/json; charset=UTF-8"
,但是默认情况下它看起来像在标头中提供"application/json"
.我正在调用Google Translate API,并且需要传递一些特殊字符.
I am using IBM API connect with Gateway script to change content type
to "application/json; charset=UTF-8"
but looks like by default it gives "application/json"
in header. I am calling Google Translate API and needs to pass some special character.
我在这里想念什么?
只需回答我自己的问题即可.在发送JSON响应之前,我已经在映射策略中使用了"application/json; charset = UTF-8",它可以正常工作.如果设置不正确,则网关脚本将无法更改内容类型.这就是我的工作方式,但不确定我的上述说法是否正确:)
Just answering to my own question. I have used "application/json; charset=UTF-8" in the map policy just before sending the JSON response and it worked. If it is not set properly then Gateway Script wont be able to change the content type. This is how I made it work but not sure if my above statement is exact right :)