【发布时间】:2017-01-21 13:36:28
【问题描述】:
我希望能够同时发送给两者 1. Web API 2. Postman 到 Web Api
我可以使用 Postman 对我的 Web Api 进行简单的 GET 请求,但我不明白如何发送字节数组。
对于 Postman,我知道这是一个 PUT
这是 Web api 签名
[Route("api/Manifest/VerifyChain/")]
[ResponseType(typeof (VerifyManifestChainResponse))]
public IHttpActionResult PutVerifyManifestChain([FromBody] VerifyManifestChainRequest message)
{
//.....
}
请求类
public class VerifyManifestChainRequest
{
public byte[] CalculatedMeasurement { get; set; }
public string DeviceId { get; set; }
}
我应该使用 Postman 通过原始数据发送 JSON 吗?
{
"CalculatedMeasurement": ?????,
"DeviceId": "00022B9A000000010001"
}
我知道网页何时调用 Web Api,我确实在 Inspector 中看到了这一点
邮递员 sn-p
如何通过 Postman 发送数据,以及如何发送到 web api http://localhost:42822/api/Manifest/VerifyChain/
【问题讨论】:
-
也许 "CalculatedMeasurement" : [12,12,34,...] 考虑每个项目不应大于 255
-
你解决过这个问题吗?
标签: json api asp.net-web-api postman