F# 重定向在温文尔雅中似乎不起作用
我尝试重定向到一个index.html页面,路径为“/hello”>>=redirect“index.html”,它不断给出错误“没有收到数据”ERR\u EMPTY\u响应。我认为在Suave中重定向没有任何问题。以下对我来说很好:F# 重定向在温文尔雅中似乎不起作用,f#,suave,F#,Suave,我尝试重定向到一个index.html页面,路径为“/hello”>>=redirect“index.html”,它不断给出错误“没有收到数据”ERR\u EMPTY\u响应。我认为在Suave中重定向没有任何问题。以下对我来说很好: #r @"packages/Suave/lib/net40/Suave.dll" open Suave open Suave.Web open Suave.Http open Suave.Http.Applicatives choose [ path "/i
#r @"packages/Suave/lib/net40/Suave.dll"
open Suave
open Suave.Web
open Suave.Http
open Suave.Http.Applicatives
choose
[ path "/index.html" >>= Successful.OK "Hello"
path "/redir" >>= Redirection.redirect "/index.html" ]
|> startWebServer defaultConfig
正如Fyodor在评论中提到的,我会检查
index.html
的处理程序是否工作正常。您还可以在Fiddler或Chrome开发工具中检查返回的重定向头。是否还为“index.cshtml”定义了处理程序?