![](/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.