Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I am trying to retrieve data from the server, after sending multiple parameters to the server. this is my Web API Config:

            config.Routes.MapHttpRoute(
            name: "DefaultApi",
            routeTemplate: "api/{controller}/{id}",
            defaults: new { id = RouteParameter.Optional }
            );

In my controller I have 2 GET sections:

        public IEnumerable<string> Get()
    {
        return new string[] { "value1", "value2" };
    }

    // GET api/<controller>/5

    public List<Object> Get( string p1, string p2, string p3, string p4,
       string p5, string p6, string p7)
    {
      //Do Some Code

    }

I want to call the GET with multiple parameters so I do it like this:

        self.SearchFunc = function (P1, P2, P3, P4, P5, P6, P7) {
        var promise = _$http({
            method: "GET",
            url: 'api/Order',
            params: {
                "P1": P1, "P2": P2,
                "P3": P3, "P4": P4,
                "P5": P5, "P6": P6,
                "P7":P7
            }

        }).success(function (data, status, headers, config) {

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

        });
        return promise;
    };

First of all is this the right way to send many parametrs in order to get data from the server? I tried this way, but the debug shows that the code enters the first GET.

share|improve this question
    
you can use the network tab of google chrome to see the call made to the server. And maybe you can change the name of the method to see if the call works. – Davide Lettieri May 15 '14 at 7:41
    
Did what you say, found the problem. Thanks – Lichte May 15 '14 at 7:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.