question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can't use "get" with parameters

See original GitHub issue

This is my code

var data = {page: page};
                this.$http.get('api/products', data ).then(
                        function (response) {
                            //look into the routes file and format your response
                            this.$set('items', response.data.data.data);
                            this.$set('pagination', response.data.pagination);

                        }, function (error) {
                            // handle error
                        });

I got this from this example https://github.com/JellyBool/laravel-vue-pagination/blob/master/resources/views/welcome.blade.php#L94

But I cant use GET, it doesn’t send the parameters. Only clean url (/api/products) What am I doing wrong?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:10

github_iconTop GitHub Comments

70reactions
afigienascommented, Aug 8, 2016

with 0.9 you need to use params attribute:


                this.$http.get('api/products', {params:  {page: page}} ).then(
                        function (response) {
                            //look into the routes file and format your response
                            this.$set('items', response.data.data.data);
                            this.$set('pagination', response.data.pagination);

                        }, function (error) {
                            // handle error
                        });
7reactions
wonderbeyondcommented, Jan 9, 2017

No clear document about this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express app returns "Cannot GET /" on routing with query ...
I'm trying to write the very simple nodejs express application, but it fails on routing request with query parameters ...
Read more >
Create Parameters - Tableau Help
A parameter is a workbook variable such as a number, date, or string that can replace a constant value in a calculation, filter,...
Read more >
How to Access Query Parameters in Javascript - Rad Devon
We can use the window 's location object to get the parameter string. The parameter string is in the search property. const queryParamsString ......
Read more >
Let report readers use field parameters to change visuals ...
To get started, you first need to enable the Field parameters preview feature. In Power BI Desktop, go to File > Options and...
Read more >
axios.get with parameters gives me error - Laracasts
axios.get with parameters gives me error ... app.js:45238 TypeError: Cannot use 'in' operator to search for ... Cant figer out what is wrong...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found