I have a very simple ASP.NET Core API. I'm sending headers to this service and it works well.
But the problem is that when I send a character such like "á" in a request header, the request fails with 400: Bad request.
I know this is not a problem with the client—I tested the same code against a Java API and it worked. I also reproduced the same problem with Postman.
How can I tell the server to accept UTF-8 in the request headers?
[HttpPut("/api/Test")]
public IActionResult test([FromHeader(Name = "Word")] String word)
{
return Ok("I accepted your request");
}
Edit:
It worked with 3.1, so now we know this is 2.1 related.
