dotnet / dotnet/AspNetCore.Docs
Polymorphic model binding requires FormData
- Dominant language
- C#
- Stars
- 13.1k
- Forks
- 24.6k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 97
Description
Under the section 'Polymorphic model binding' it would be extremely helpful if it stated that the Request `Content-Type` header must be `multipart/form-data` or `application/x-www-form-urlencoded`. I wasted a considerable amount of time trying to figure out why it wasn't working for `application/json`.
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: cfb00531-4ac6-8bf6-9bd8-1eed6446397f
* Version Independent ID: ed418d09-6c33-699a-0d48-9aabc99457be
* Content: [Custom Model Binding in ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/mvc/advanced/custom-model-binding?view=aspnetcore-5.0)
* Content Source: [aspnetcore/mvc/advanced/custom-model-binding.md](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/mvc/advanced/custom-model-binding.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-mvc**
* GitHub Login: @ardalis
* Microsoft Alias: **riande**
Contributor guide
Assessment
This issue has not been assessed yet.