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

Sending an array in a GET request turns it into a string #52

Open
ragaeeb opened this issue Aug 3, 2020 · 1 comment
Open

Sending an array in a GET request turns it into a string #52

ragaeeb opened this issue Aug 3, 2020 · 1 comment
Labels
compat Compatibility issue

Comments

@ragaeeb
Copy link

ragaeeb commented Aug 3, 2020

If you send an array as a parameter in a GET request, redaxios turns that into a string separated by commas. This seems like a bug.

On the server-side (ie: PHP) we would expect that to be provided as an array, but it ends up being a string.

In axios this is correctly kept as an array.

@developit developit added the compat Compatibility issue label Sep 5, 2020
@TommyDew42
Copy link

Got the same behaviour in my local laptop:

redaxios.get("some-url", {
  params: {
    names: ["name-1", "name-2"],
  },
});

On the backend, we got:

// redaxios
{ names: 'name-1,name-2' }

// axios
{ names: ["name-1", "name-2"] }

Is this sth expected?
Happy to work on it if this is confirmed to be a bug!

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

No branches or pull requests

3 participants