What is the difference between returning a Mirage.Response object vs returning a raw JSON object through Mirage?
<p>I am trying to build an EmberJS test server in the browser. I have an API call to "myApiMethod", from which I am trying to GET a JSON object. While trying to test the response from a specific method I found out that that I can either return a raw json object, or wrap it in a Mirage.Response object. Since I wanted the mock server's response to be reflective of the real world, I wasn't sure which of the two was a better idea.</p>

<p>What I wanted to know was the functional differences between the following two chunks of code that I have in my Mirage's config.js:</p>

<p><strong>Version 1:</strong></p>

<pre><code>    this.get('/myApiMethod', function(param1, param2){
        var jsonObject = myFunctionThatReturnsJson(param1, param2);
        return jsonObject;
    });
</code></pre>

<p><strong>vs.</strong></p>

<p><strong>Version 2:</strong></p>

<pre><code>    this.get('/myApiMethod',function(param1, param2){
        var jsonObject = myFunctionThatReturnsJson(param1, param2);
        return Mirage.Response(200, {}, jsonObject); 
    });
</code></pre>