在邮递员中发送实体模型

Maj*_*aki 4 asp.net asp.net-web-api postman

我创建了一个Web API,想与邮递员检查它,但不知道如何发布我的实体模型。总是模型为null

我使用[FromForm]向我发送模型,但所有值均为null,当使用[Frombody]发送给我

fed*_*zzi 7

your error is the CONTENT TYPE you're using to send the request..您选择x-www-form-url-encoded(HTML格式的格式).. BUT if you want to use WebAPI and send your Entity in the PAYLOAD of yours request via REST .. you have to set CONTENT - TYPE as application/JSON..

所以 in POSTMAN do:

1-选择类型 RAW

2-在出现的下拉菜单中选择 application/json

3 paste your JSON in the Text Area

4 send it

希望对您有帮助!!