Other output formats (XML instead of JSON)

We’re planning on deploying Kong in front of our API.

Our API currently returns its data in both XML as JSON depending on the Accept header. This is a strict requirement for us.

When setting up the plugin (OAuth, Rate limiting,…), I’ve noticed the end-user-output is only in JSON and the Accept header is ignored.

Is it possible to also somehow have these plugins return XML (automatically?). Hopefully without having to maintain a fork of each plugin?



Is it possible to also somehow have these plugins return XML (automatically?)

That is not possible. These plugins only work with JSON.


As the last response was over a year ago, I am wondering if anyone know if there are any new/custom plugins out there to get rate limiting response in xml format when the accept header is application/xml?

Sorry to disappoint but the answer is still no in this situation. XML generally is just viewed as an archaic way to model data as its more bulkier than JSON. And even today now we are seeing my http3/grpc binary and these streaming proto’s shaking things up even more :slight_smile: .

If XML support is needed I would say a fork is probably your best bet. There are some LUA libs out there dealing with XML but they don’t seem fun to work with honestly and are not as intuitive as I would like personally.

1 Like