When I try to post a string to my web api, the value is null. I have tried wrapping it in quotes, but it is still null.
AngularJS code:
return $http.post("http://localhost:59437/api/Recaptcha/Post",
vcRecaptchaService.getResponse());
Web Api code:
[EnableCors("*", "*", "*")]
public class RecaptchaController : ApiController
{
public string Post([FromBody] string response)
{
return response;
}
}
I also am not sure how this even works because, i don't have a response in my form body. vcRecaptchaService.getResponse() just returns a response string and then I am going to send that to google's verify api to verify the recaptcha, so the [FromBody] part doesn't make sense to me if that is not part of the body
vcRecaptchaService.getResponse()method does?