AngularJS http request POST

Hi Experts,

I want to pass Two JSON Arrays  (i.e customers and users) and two other values to a webService,  how can I do that in angular.

The existing code is like following where I  need to do this change:

 
$http({
                url: someURL + '/Customers',
                method: 'POST',
                params: {
                    '$filter': common.format("IsCustomer eq {0}", returnCustomers),
                    '$select': me.selectedProperties,
                    'isR': isR,
                    '$orderby': 'CustomerName'
                },               
            }).success(function (data, status, headers) {

            }).error(function (data, status, headers) {

            });

Open in new window


Or would you suggest passing json array as string so that I can easily do like this on server side

http://stackoverflow.com/questions/9586585/convert-json-to-a-c-sharp-array, however it just give me option of passing one array! Two required!

Also the json arrarys can be of considerable length so that's why Post required.

Please help.
Dinesh KumarAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shinesh PremrajanEngineering ManagerCommented:
You need to create a common Json in that you need to add the customer and the user json.Something like this

mainJson ={"custmr":customer,"user":user}

Then this main Json need to be parsed at the other end.Hope this helps

If this is not wht you are intended, then pls let us know

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dinesh KumarAuthor Commented:
hmm and how to pass this in current request..

Should I use $filter or ?

I was thinking parsing two different arrays will be easier then the one as you suggested.

please advice.
Dinesh KumarAuthor Commented:
The service I am hitting is odata service.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.