mockfly logo

JSON and XML Support

Introduction

What type of content-type can you return with Mockfly? Just JSON? What if I want to return XML? Currently,we support both JSON and XML. JSON support is the default, and if you wish to return XML, you need to change the content type of your mock API response to indicate that you want to return XML.

How to return XML in my mock API

To return XML, you need to configure the content-type header to return "application/xml". This will change the content-type, allowing Mockfly to return XML. To do this, switch to the "Headers" tab from the endpoint where you want to return XML.

Once there, you can create (if you aren't already using it) the content-type header and replace it with "application/xml".

Next, navigate to the body tab, and you can then modify the body to include the XML you need in your endpoint response.

Create a project