Вот контроллер:
public class RECAPTCHAController : ApiController
{
[HttpPost]
public HttpResponseMessage Post(string response)
{
bool verified = Models.ReCaptcha.Verify(HttpContext.Current.Request);
return this.Request.CreateResponse(HttpStatusCode.OK, new { verified = verified });
}
}
Я использую Angular для вызова этого контроллера следующим образом:
$http.post(API_ENDPOINT + '/RECAPTCHA/Post', { response: vm.recaptcha }).
success(function (data, status, headers, config) {
vm.captchaVerified = data.verified;
});
Я получаю следующую ошибку:
{"Message":"No HTTP resource was found that matches the request URI 'http://localhost:64189/api/RECAPTCHA/Post'.","MessageDetail":"No action was found on the controller 'RECAPTCHA' that matches the request."}
попробуй это
$http.post(API_ENDPOINT + '/RECAPTCHA/', vm.recaptcha).
success(function (data, status, headers, config) {
vm.captchaVerified = data.verified;
});