Asp.net
在郵遞員中發送實體模型
我創建了一個 Web API 並想用郵遞員檢查它,但不知道如何發布我的實體模型。總是模型為空
我用
$$ FromForm $$向我發送模型,但所有值均為空,並且在使用時$$ Frombody $$ 發送空
.
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-選擇類型
RAW2-在出現的下拉列表中選擇
application/json3-
paste your JSON in the Text Area4-
send it希望對你有幫助!!