Skip to main content
edited tags
Link
ASh
  • 35.9k
  • 9
  • 68
  • 89

c# winform json string creation with c#

Source Link
kacalapy
  • 10.2k
  • 20
  • 78
  • 123

c# winform json string creation

I am creating a string variable to use in an rest post call and it is failing. when I debug and look at the json value I am told it is not in json format. It sure seems to be key:value pairs so I an not sure what the issue here is?

instead of double single quotes I also tried escaping the " by using \ like so (neither method is good it seems):

//string postData = "{\"title\":\"Change Title\",  \"description\":\"Create description\",  \"scheduledStartDate\": \"2018-12-24T11:24:48.91Z\",  \"scheduledEndDate'': ''2018-12-25T11:24:48.91Z''  }";

    string postData = @"{''changeNumberForClone'': ''C03688051'',
                        ''scheduledStartDate'': ''2017-12-24T11:24:48.91Z'',
                        ''scheduledEndDate'': ''2017-12-25T11:24:48.91Z''}";        

enter image description here