Lalit
Lalit

Reputation: 352

Input an array in the Rest Web service

I am creating a REST Web service in C# and need to take a list of item (e.g. activity list).

How can we take an array as input in Rest Web Service method? What would be final URI that will be created for such method?

Upvotes: 1

Views: 1704

Answers (1)

talnicolas
talnicolas

Reputation: 14053

For what I know (I developed ReST services in Java with the Jersey library), the final URI is not affected by the type of the parameters you pass to the service. So the URI would be something like http://asite.com/service/activitylist.

Then for the implementation (in Java, maybe you could try to look for a REST implementation library in C#), in the client I would put my parameters (any type, arrays too) in a Form object (Jersey) and send it with my request. Then in my service I would access my parameters using the annotation @FormParam and finally process them normally in my service.

Hope it helps.

Upvotes: 1

Related Questions