WebInvoke | Parameter as List<>

Topics: Web Api
Dec 29, 2010 at 10:39 AM

Hi,

at the moment I'am designing an REST-Interface and now I have a method that stores / updated a collection of key=value pair in the Database. What is the best way to do that....using a List<MyType>, Dictionary<string, string>? I use the WebInvoke (Method = POST) to submit the data.

Thanks,

Daniel

Jan 7, 2011 at 2:14 PM

Hi Daniel,

I would recommend using application/x-www-form-urlencoded as the media type.  It is designed to handle key value pairs.  The WCF HTTP library has built-in support for this media type.