How to send json with byte in web api / postman

I want to be able to send both 1. web interface 2. Postman in Web Api

I can perform simple GET requests to my web interface using Postman, but I don't understand how to send an array of bytes.

With the Postman, I know this is POSITION

This is a web API signature.

[Route("api/Manifest/VerifyChain/")]
[ResponseType(typeof (VerifyManifestChainResponse))]
public IHttpActionResult PutVerifyManifestChain([FromBody] VerifyManifestChainRequest message)
{
   //.....
}

Request Class

public class VerifyManifestChainRequest
{
    public byte[] CalculatedMeasurement { get; set; }
    public string DeviceId { get; set; }
}

Should I send JSON via Raw Data using Postman?

{
   "CalculatedMeasurement": ?????,
   "DeviceId": "00022B9A000000010001"
}

I know when a web page calls a web interface, I see it in the Inspector

enter image description here

Fragment of the postman

enter image description here

How to send data via Postman and how to send to the web interface? http: // localhost: 42822 / api / Manifest / VerifyChain /

+11
source share
1 answer

, Webapi [HttpPut]

[HttpPut]
[Route("api/Manifest/VerifyChain/")]
[ResponseType(typeof (VerifyManifestChainResponse))]
public IHttpActionResult PutVerifyManifestChain([FromBody] VerifyManifestChainRequest message)
{
   //.....
}

{
  "CalculatedMeasurement":[71,107,98],
  "DeviceId": "afdghufsdjdf"
} 
0

Source: https://habr.com/ru/post/1654505/


All Articles