Hi!
I’m trying to interact with ROS 7.14.3 using C# HttpClient. With GET I can easily parse things to record classes. However when I’m trying to use PUT, I have some problems. Example:
public record NAT
{
[JsonPropertyName("chain")] public string Chain { get; set; }
[JsonPropertyName("action") public string Action { get; set; }
}
gw_client.BaseAddress = new Uri("http://192.168.0.15:80/rest/");
var result = await gw_client.PutAsJsonAsync<NAT>("ip/firewall/nat", natRule);
This generates
{“chain”:“dstnat”,“action”:“accept”} PUT
But I get
{“detail”:“missing =chain=”,“error”:400,“message”:“Bad Request”}
as a response. Sending same JSON body with Postman creates rule no problem. What can cause this problem?