cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass arg to reoute

how to pass arg to reoute

Hello ewerybody!

 

 

I programming in C#. I have problem with pass arg to route. This is my code:

I want all items from any order. I pass id order and my result from method are all items.

 

Please help me.
        public OrderResponse GetAllOrdersItems(int id)
        {
            var token = GetBearerToken().Trim('"');
            var client = new RestClient { BaseUrl = new Uri(_host) };
            var request = new RestRequest(Method.GET);
            request.AddHeader("Content-Type", "application/json");

            request.AddHeader("Authorization", "Bearer " + token);
            //request.AddParameter("id", id);
            request.Resource = "rest/V1/orders/1/items";
            var response = client.Execute<OrderResponse>(request);
            return response.Data;
        }

 

 

 

 

Kind Regards.

1 REPLY 1

Re: how to pass arg to reoute

Ok! I know. "rest/V1/orders/"+ id.tostring() +"/items"