I have an ASP.NET Core 7 Web API service implemented in C# and a method defined like this:
[ApiController]
[Route("api/[controller]")]
public class SensorsController : ControllerBase
{
// ...
[HttpGet("{sensorname}/zf")]
public async Task<ActionResult> GetZForecast(string sensorname, [FromQuery]DateTime? when, [FromQuery]string? wind)
{
// ...
}
}
I want to test it with this curl command:
curl -X get https://localhost:7091/api/Sensors/VK_THC_GreenRoom/zf?when="2025-03-15T08:00:00Z"&wind="Calm"
Why is the wind parameter not captured by the controller in this case?
If I use only one of the optional query parameter like shown below, then all works just fine and both wind and when are captured respectively:
curl -X get https://localhost:7091/api/Sensors/VK_THC_GreenRoom/zf?when="2025-03-15T08:00:00Z"
curl -X get https://localhost:7091/api/Sensors/VK_THC_GreenRoom/zf?wind="Calm"
So what am I missing ?

https://localhost:7091/api/Sensors/VK_THC_GreenRoom/zf?when=2025-03-15T08:00:00Z&wind=Calm