Unable to Change Content-Type to “application/json; charset=UTF-8”

做~自己de王妃 提交于 2019-12-13 10:19:28

问题


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.

What am I missing here?


回答1:


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 :)



来源:https://stackoverflow.com/questions/52324848/unable-to-change-content-type-to-application-json-charset-utf-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!