Smartdocs assigning header as "application/json; charset=UTF-8" by default for POST requests

g-gagan1000
Participant III

Hi All,

Recently we came across a scenario, in which smartdocs by default assign the Content-Type header as "application/json; charset=UTF-8" for POST requests. But the actual Content-Type header given as the header input is application/json.

Any idea why this is happening. I have also attached screenshots for reference.

Screen 1 - Header Parameters given as input in smartdocs:

4145-2016-12-28-12h40-38.png

Screen 2 - Request Sent By Smartdocs to API proxy

4146-2016-12-28-12h41-40.png

(Here the Content-Type header is changed to application/json; charset=UTF-8)

Screen 3: Request trace Received in Edge

4147-2016-12-28-12h42-07.png

Any help is appreciated!

2 2 1,398
2 REPLIES 2

Likely happening due to the request stack. What happens if you specify a different charset in the form? Does it get overridden?

Hi @Carlos Eberhardt ,


One thing I have observed while struggling with this issue is when I am defining the body payload schema inline in Open API Specs, then the Content-Type header is sent as "application/json" i.e. exactly what I am sending in the input box. But, when I am defining the body payload schema through the reference, then smartdocs automatically appends ";charset=UTF-8", no matter what is given as input in Content-Type header. Example: If I send "application/xml" , it is automatically getting converted to "application/xml ;charset=UTF-8"

If I send "application/json; charset=UTF-16", then smartdocs is sending "application/json; charset=UTF-8", i.e., sending different charset does not override the charset value.

Note: I am defining the body payload schema from reference schema since inline schema definition is not working in smartdocs, as suggested by @Madhan Sadasivam in the below community article:

https://community.apigee.com/questions/8208/smartdoc-body-request-field-is-not-rendered.html