I have an ASP.NET web API and I am responding to a request in this format,
[HttpPost]
[Route("")]
public HttpResponseMessage AlexaSkill()
{
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, "value");
response.Content = new StringContent("put json here", Encoding.UTF8);
response.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
return response;
}
and it works great. The problem is that there is a certain situation when the requester does not expect a response. I cannot figure out how to not respond to a request that sends a url. How can I get an answer similar to the above, and also be able to have a function that does not give a function acting like a void function?
source
share