2012-12-22 62 views
0

我发送一个json有效载荷到我的WebApi动作中。有一段时间,所述参数为空,但然后我改变了的内容类型为application/X WWW的窗体-urlencoded现在对象来通过,但其所有成员都为空值或默认值json有效负载通过零成员

enter image description here

enter image description here

enter image description here

任何想法?

回答

1

如果您正在查找JSON有效内容,则内容类型应为Content-Type: application/json

如果您像现在一样使用application/x-www-form-urlencoded,那么您将强制使用无法读取JSON输入的格式器。

+0

叹......好吧,所以我以前使用过应用程序/ json,它是作为一个空对象而来的。我只是将其更改回应用程序/ json并且它再次运行。谢谢。 – Sinaesthetic