Hi guys.. I wanna make my inputData more readable. i have using Formatting.Indented but the output is still displayed in a line.
Dim inputData As Object = New With {
.serviceType = "MOTORCYCLE",
.delivery = New List(Of Object) From {
New With {
.toContact = New List(Of Object) From {
New With {
.name = "Bruce Barner",
.phone = "+659855365"
}
}
}
},
.pickup = New List(Of Object) From {
New With {
.name = "Tony Stark",
.phone = "+659855235"
}
}
}
Dim body As String = (New JavaScriptSerializer()).Serialize(inputData)
Response.Write(Newtonsoft.Json.Linq.JValue.Parse(body).ToString(Newtonsoft.Json.Formatting.Indented))
How can i make the output like something below:
{
"Sizes": [
"Small",
"Medium",
"Large"
],
"Price": 3.99,
"Expiry": "\/Date(1230447600000-0700)\/",
"Name": "Apple"
}