I need to send via REST (not including some other sensitive information):
{"@Scope": "Local"}
In the class file I JsonProperty
for Json.Net serialization:
[JsonProperty("@Scope")]
public string Scope { get; set; }
When putting together the json message to be sent via WebRequest, I have
{@Scope = "Local"}
But after running:
string jsonString = System.Text.Json.JsonSerializer.Serialize(message);
The message being sent out is
{"Scope": "Local"}
For some reason I though System.Text.Json will pick up JsonProperty
attributes but apparently there should be some other way.