Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not clear how to send a json array in a get request #40

Open
harlangray opened this issue Aug 16, 2018 · 2 comments
Open

Not clear how to send a json array in a get request #40

harlangray opened this issue Aug 16, 2018 · 2 comments

Comments

@harlangray
Copy link

Can you explain how to pass the json array in a get request? I tried using online json to query parameter converters but didnt work

@DiegoRodriguezTandil
Copy link

I'm having the same problem right now. I configured the filter_group param property but the json is not decoded into array.

@DiegoRodriguezTandil
Copy link

DiegoRodriguezTandil commented Oct 21, 2018

In order to get a work around to the problem I did use QueryString library (https://www.npmjs.com/package/qs)

import qs from 'qs'
...
               axios.get("/api/v1/endpoint?"+qs.stringify({
                    filter_groups: [{
                            filters: [{
                                key: 'id',
                                value: 2,
                                operator: 'eq'
                            }]
                        }]
                })).then(response => {
                    console.log(response);
                }).catch(function (e) {
                    this.dispatch('error', e);
                }.bind(this));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants