我的HttpWebRequest
主体需要采用JSON数组格式,我必须在运行时动态填充它。
Dim body As String = "{""studentForm"":[{""title"":""Law Major"",""description"":""Excellent Student. Work hard. Very Intelligent, and so on..."",""phone"":""0123456789"",""categoryId"":1197,""categoryName"":""Senior Student"",""parentCategory"":9,""location"":{""latitude"":45.151053,""longitude"":-79.398193,""radius"":1000},""categoryAttributes"":[],""imageUrls"":[]}]}"
因此我需要将varTitle
,varDescript
,varDescript
等变量放入JSON数组中。我尝试以下方式做到这一点,但是没有用。
Dim body As String = "{""studentForm"":[{""title"":varTitle,""description"":varDescript,""phone"":varDescript,""categoryId"":1197,""categoryName"":""Senior Student"",""parentCategory"":9,""location"":{""latitude"":45.151053,""longitude"":-79.398193,""radius"":1000},""categoryAttributes"":[],""imageUrls"":[]}]}"
我从几个网站上读到了反序列化/序列化,但仍然无法实现我所寻找的目标。