Reputation: 12241
I'm sending a json payload into my WebApi action. For a while, the parameter was null, but then I changed the content type to application/x-www-form-urlencoded and now the object comes through, but all of its members are null or default values
Any ideas?
Upvotes: 0
Views: 442
Reputation: 27187
If you are seding a JSON payload then the content type should be Content-Type: application/json
.
If you use application/x-www-form-urlencoded
like you do now, you are forcing a use of a formatter that's not capable of reading a JSON input.
Upvotes: 1