问题
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