Send object with axios get request : <p>I want to send a get request with an object. The object data will be used on the server to update session data. But the object doesn't seem to be sent correctly, because if I try to send it back to print it out, I just get:</p>

<p><code>" N; "</code></p>

<p>I can do it with jQuery like this and it works:</p>

<pre><code> $.get('/mysite/public/api/updatecart', { 'product': this.product },  data =&gt; {     
              console.log(data);
           });
</code></pre>

<p>The object is sent back from server with laravel like this:</p>

<pre><code>public function updateCart(Request $request){
      return serialize($request-&gt;product);
</code></pre>

<p>The same thing doesn't work with axios:</p>

<pre><code>axios.get('/api/updatecart', { 'product': this.product })       
                .then(response =&gt; {
                    console.log(response.data);
            });
</code></pre>

<p>I set a default baseURL with axios so the url is different. It reaches the api endpoint correctly and the function returns what was sent in, which was apparently not the object. I only get "<strong>N;</strong> " as result.</p>
