golang: github/gorilla/mux 支持回归 url 路径

问题描述 投票:0回答:0

当我想要 url 路径工作正常时,有尾巴“/”,没有尾巴“/”

mux1 *mux.Router

mux1.Handle("/example/", ...).Methods(方法)

我希望这两个 url 都有效:https://host/api/example/ 和 https://host/api/example

但是

mux1.Handle("/example/?", ...).Methods(方法)

不工作。

有人可以帮忙吗?谢谢!

go http path gorilla
© www.soinside.com 2019 - 2024. All rights reserved.