![](/img/trans.png)
[英]How to add below request body (string) in Postman using http client?
[英]How to pass string in post request body in postman
我有一個 POST API 端點,即
[Route("api/{parameter1}/employee")]
[HttpPost]
public Employee RegisterEmployee(string parameter1, [FromBody] string parameter2)
現在,我想從 postman 中找到這個 API。
我的要求 URL 是:
http://localhost:xxxxx/api/parameter1/employee
身體是:
所以,通過這種方式我得到:415 Unsupported Media Type 錯誤。
如果我嘗試其他方式,那么我可以點擊 API,但參數 2 總是以 null 的形式出現。
那么,我應該如何傳遞 postman 中的 parameter2 值?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.