我有一个简单的插件post处理程序,如下所示
post "/some/url" do
# do something
# render(something)
end…但我想以某种方式重定向到另一个get处理程序,而不是呈现html。
如何使用plug_cowboy 2.0做到这一点?
发布于 2019-08-17 23:52:24
没有什么神奇之处:你必须发送HTTP 302响应:
conn
|> put_resp_header("location", url)
|> send_resp(conn.status || 302, "text/html", body)菲尼克斯does the same。
https://stackoverflow.com/questions/57537411
复制相似问题