bruno icon indicating copy to clipboard operation
bruno copied to clipboard

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

Open harlangray opened this issue 6 years ago • 2 comments

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

harlangray avatar Aug 16 '18 00:08 harlangray

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

DiegoRodriguezTandil avatar Oct 19 '18 19:10 DiegoRodriguezTandil

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));

DiegoRodriguezTandil avatar Oct 21 '18 23:10 DiegoRodriguezTandil