2

I have a controller method:

[HttpPost]
public HttpResponseMessage SetKitten([FromBody] string kittenName)
{
   return Request.CreateResponse(HttpStatusCode.OK);
}

In Swagger it appears as a POST but when I try it, swagger sends the request using query parameters:

Request URL
localhost.../KittenHandler/SetKitten?kittenName=Boris

This results in an error as it must be in the body.

Any idea why swagger is doing this?

NibblyPig
  • 51,118
  • 72
  • 200
  • 356

0 Answers0