this.$http.post not working in vue?
<p>I use vue-resource to make a post request like this:</p>

<pre><code>methods: {
        searchNodes: function (val) {
            this.loading = true;
            this.$http.post('/search_query', [val]).then(function (response) {
                this.nodes = response.data;
                this.loading = false;
            }, function (response) {
                console.log(response);
            });
        }
    } 
</code></pre>

<p>and this is my route </p>

<pre><code>Route::post('search_query', 'SearchController@search')-&gt;name("search");
    Route::resource('search', 'SearchController'); 
</code></pre>

<p>and in this is my function:</p>

<pre><code>public function search(Request $request)
    {
        dd($request-&gt;all());
    }
</code></pre>

<p>put in network tap it return status code 302 and redirect me to the login page?</p>