user8318268
user8318268

Reputation:

Send array in angularjs put mehod

as per api request i must send data categories: [1,2,3,4]

I have tried

data: {
      categories: [1,2,3,4]
}

But it gets sent as

categories[]:1
categories[]:2
categories[]:3

Not as ategories: [1,2,3,4]

How can i send an array of numbers in angularjs $http method

categories: [1,2,3,4]

Upvotes: 0

Views: 37

Answers (1)

user8318268
user8318268

Reputation:

Finally i have found the answer to my question after alot of research https://github.com/angular/angular.js/issues/3121

I should have sent it as "categories[]": [1,2,3,4]

not as categories = [1,2,3]

Upvotes: 1

Related Questions