dotnet / dotnet/AspNetCore.Docs

Polymorphic model binding requires FormData

Open
#22,959 1 comment 0 reactions 0 assignees View on GitHub
doc-enhancement Pri1 re-Aditya Source - Docs.ms
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.