I wanted to know how can we pass boolean variable into http request body using Json format?
Example :
“{”“empid”“:”“123"”,‘’‘isemployee"’:true}"
Here in place of true I wanted use boolean type variable . Can anyone suggest how can I proceed with this?
// Define your boolean variable
isEmployee = True
// Create the JSON string with the boolean variable
jsonString = $"{{""empid"":""123"",""isemployee"":{isEmployee.ToString().ToLower()}}}"
UPD1 - JSON Approach hint:
For sure we can parse the JSON String / Json Template … into JOBject and set the value by a variable with using JSON API e.g. Newtonsoft