
遇到某 C#项目
路由配置: RouteConfig:
routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { cOntroller= "Home", action = "Index", id = UrlParameter.Optional } ); 这里有个 FileController 中的函数,签名为public AResult Fetch(string url),需要传 URL 参数,我尝试 URL 编码了/:.等字符但好像还是有问题,这里正确方法应该如何调用?
同样的还有一个 Delete 函数:
public void Delete(string filePath) { UploadCls.Delete(filePath); } public static bool UploadCls::Delete(string filePath) { try { File.Delete(filePath); return true; } catch { } return false; } 在参数中传..%2F服务器会一直无响应
1 Pursue9 2019-07-26 12:34:59 +08:00 [HttpDelete("delete/{filePath?}")] public IActionResult Delete([FromRoute]string filePath) |