Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$http get-request should append [] to name when arrays #11162

Closed
filipbech opened this issue Feb 24, 2015 · 2 comments
Closed

$http get-request should append [] to name when arrays #11162

filipbech opened this issue Feb 24, 2015 · 2 comments

Comments

@filipbech
Copy link

$http({
  url:'/api',
  params: {
    arr:[1,2,3]
  }
});

Currently gives you a get request to (wrong)
/api/?arr=1&arr=2&arr=3

should give you (expected)
/api/?arr%5B%5D=1&arr%5B%5D=2&arr%5B%5D=3
(when decoded its: /api/?arr[]=1&arr[]=2&arr[]=3)

Current workaround is to append [] to the attributename like:

params: {
  'arr[]':[1,2,3]
}

but that seems weird and broken?

@pkozlowski-opensource
Copy link
Member

This is duplicate of #3740 which is going to be solved in the 1.4 time-frame.

@filipbech
Copy link
Author

perfect thankyou! you are totally right!
I did a search for it but that issue didn't come up...

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

No branches or pull requests

2 participants