[英]Unable to Change Content-Type to "application/json; charset=UTF-8"
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.我正在使用 IBM API 与网关脚本连接将
content type
更改为"application/json; charset=UTF-8"
但看起来默认情况下它在标头中提供"application/json"
。 I am calling Google Translate API and needs to pass some special character.我正在调用 Google Translate API 并需要传递一些特殊字符。
What am I missing here?我在这里缺少什么?
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.
在发送 JSON 响应之前,我在地图策略中使用了“application/json; charset=UTF-8”并且它起作用了。 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 :)
这就是我让它工作的方式,但不确定我上面的陈述是否完全正确:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.