Skip to content

Request Method is OPTIONS when Post Json #3

@NightFarmer

Description

@NightFarmer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions