{
"name": "group1",
"userData": "user-provided data attached to the person group.",
"recognitionModel": "recognition_03"
}
If I need to pass the above body in a http client call how do I format that in C#?
{
"name": "group1",
"userData": "user-provided data attached to the person group.",
"recognitionModel": "recognition_03"
}
If I need to pass the above body in a http client call how do I format that in C#?
Maybe you find your anwser here:
public void JsonStringExample()
{
string example1 = @"{
""name"": ""group1"",
""userData"": ""user-provided data attached to the person group."",
""recognitionModel"": ""recognition_03""
}";
string example2 = "{"
+ " \"name\": \"group1\","
+ " \"userData\": \"user-provided data attached to the person group.\","
+ " \"recognitionModel\": \"recognition_03\""
+ "}";
var stringBuilder = new StringBuilder();
stringBuilder.AppendLine("{");
stringBuilder.AppendLine(" \"name\": \"group1\",");
stringBuilder.AppendLine(" \"userData\": \"user-provided data attached to the person group.\",");
stringBuilder.AppendLine(" \"recognitionModel\": \"recognition_03\"");
stringBuilder.AppendLine("}");
string example3 = stringBuilder.ToString();
string exmaple4 = String.Join(
"\r\n",
new string[]
{
"{",
" \"name\": \"group1\",",
" \"userData\": \"user-provided data attached to the person group.\",",
" \"recognitionModel\": \"recognition_03\"",
"}"
}
);
}