Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在将 json 有效负载发送到我的 WebApi 操作中。有一段时间,参数为null,但后来我将内容类型更改为application/x-www-form-urlencoded,现在对象通过了,但它的所有成员都是null或默认值
有任何想法吗?
如果您要生成 JSON 有效负载,则内容类型应为Content-Type: application/json.
Content-Type: application/json
如果您application/x-www-form-urlencoded像现在这样使用,您将强制使用无法读取 JSON 输入的格式化程序。
application/x-www-form-urlencoded