I would like to use RestSharp to connect to my ASP.NET WebApi services. The WebApi handles model binding automatically, but it's very specific about how it receives json. For example, consider the following:
Public Class DTO
Property JsonDictionary As Dictionary(Of String, String)
End Class
The ASP.NET WebApi will Model-bind this appropriately if I send this to my POST:
{
"JsonDictionary[0].Key":"key1",
"JsonDictionary[0].Value":"value1"
}
I would like to use RestSharp or JSON.NET to serialize dictionaries in this format and send Content-Type: application/json. Can I use these to accomplish my goal or will I need to write my own serializer? Any help is appreciated.