标签: c# attributes model-binding asp.net-core-webapi request-headers
如何从标头绑定对象。我使用[FromHeader(Name = "Custom-Object")],但它似乎只能绑定字符串和sting数组。我需要编写自定义绑定还是我错过了什么?我想知道为什么fromheader不能绑定像body这样的复杂对象?
[FromHeader(Name = "Custom-Object")]
答案 0 :(得分:0)
使用IModelBinder and IModelBinderProvider编写可解决您问题的自定义活页夹。