Я пытаюсь запросить данные из моей базы данных с помощью Web Api. Проблема в том, что я получаю сообщение об ошибке при отправке запроса получения с почтальоном. Я установил точки останова в моей программе, но метод не получает запрос.
{
"Message": "The requested resource does not support http method 'GET'."
}
Я пытаюсь запросить следующую строку:
https://localhost:44384/api/advertentie/search?location=Makarska&property=null&price=null&rooms=null&beds=null&baths=null
public class QueryModel
{
public string Location { get; set; }
public string Property { get; set; }
public decimal? Price { get; set; }
public int? Rooms { get; set; }
public int? Beds { get; set; }
public int? Baths { get; set; }
}
[HttpGet]
[Route("api/advertentie/search{Location}/{Property}/{Price}/{Rooms}/{Beds}/{Baths}")]
public IHttpActionResult Search([FromUri] QueryModel query)
{
}