Given below is my WebApi method, and I want to test it with Postman, but whenever I submit the request, myKey always contains the null value.
[Route("Complete")]
[HttpPost]
[Authorize]
public async Task<IHttpActionResult> Complete([FromBody]string myKey)
{
// My logic
}
And this how I am submitting the request via Postman.
I have found many post suggesting how can we submit the data from Web but not a single one showing same using Postman.
Can you please guide me to get the value of myKey via Postman tool?
Pass just the value from the request body. When you add the [FromBody]
attribute for a simple type parameter like string
, the body will be read as string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With