swagger icon indicating copy to clipboard operation
swagger copied to clipboard

Request Method is OPTIONS when Post Json

Open NightFarmer opened this issue 5 years ago • 1 comments

When I use the POST method to accept the JSON parameter, click the Try it out button, and swagger sends an OPTIONS type request.

here is my code:

// @Accept  json
// @Param req body bean.Dog true "InstanceCreateReq"
// @Success 200 {string} string	"ok"
// @Router /demo/dog [post]

the request by swagger try is:

Request URL: http://127.0.0.1:8888/demo/dog
Request Method: OPTIONS
Status Code: 404 Not Found
Remote Address: 127.0.0.1:8888
Referrer Policy: no-referrer-when-downgrade

NightFarmer avatar May 21 '19 16:05 NightFarmer

Hello @NightFarmer, can you post a repository example that can reproduce this case?

kataras avatar May 25 '19 01:05 kataras