首页 文章

在邮递员中发送实体模型

提问于
浏览
3

我创建了一个 Web API,并希望用邮递员检查它,但不知道如何发布我的实体 model.always 模型为 null

我使用[1]发送给我模型,但所有值都为 null,当使用[2]发送 null 时

1 回答

  • 6

    your error is the CONTENT TYPE you're using to send the request ..你选择x-www-form-url-encoded(HTML FORMS 的格式).. 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

    希望它能帮到你!!

相关问题