ā Logging incoming HTTP requests with WebApplication
I've got a route in my app that isn't being triggered properly. I can't currently figure out what's wrong with it.
My controller is being constructed, but the method is never called.
Is there a way that I can turn on additional logging? I'd initially like to know what JSON is being passed in, and what HTTP action is being called After that, some kind of information as to why it isn't calling the method (parameter don't match, for example) would be really useful.
Thanks
4 Replies
Note : I'm using .NET 7
can you share $code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/Here's the code that builds and starts my WebApplication:
I've just spotted something in here that might be causing the issue...
The type being passed through has two
HashSet
properties - they serialize properly, but may not deserialize
š¤¦ it was because the type I was passing in didn't have a parameterless constructor, so couldn't be deserialized...