How would I serialize url parameters for use with axios? My parameters are just numbers in array [1,2]
. Here is my code so far
axios({
method: 'delete',
url: '/api/'
})
My request url will be something like this http://127.0.0.1:8000/api/?id=1&id=2
I looked at the paramsSerializer
method that axios has but its confusing how it can be used or whether its even appropriate in my case. Please advice. Thanks
the
config
object ofaxios.get
acceptsparams
. Inparams
you can specify your array and it will do the conversion for you.Here is an example:
This will make a request which looks like this: