我有麻煩將圖像網址傳遞給我的API控制器。通過獲取參數asp-net發送網址Api
控制器:
[HttpGet]
[Route("cont/getByUrl/{url}")]
public string Get(string url)
{
//code
}
我的Ajax調用
$.ajax({
url: "http://localhost:64444/api/cont/getByUrl/"+ encodeURIComponent("http://www.moooi.com/sites/default/files/styles/large/public/product-images/random_detail.jpg?itok=ErJveZTY"),
type: 'GET'
});
如果我的參數是一個簡單的字符串,我到那裏,但如果我發送一個地址始終有404,我使用IIS 7.5。
我需要對Web.config進行一些更改,或者我無法做到這一點?