I've set up an ashx page to receive a webhook notification. However, I'm getting and error from the webhook provider that my response contains a body. For the moment I just want to send a status code of 200. This is my code :-
public class updateTS : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.StatusCode = 401;
}
public bool IsReusable
{
get
{
return false;
}
}
}
As far as I can see my content does not have a body. What am I doing wrong?
Use context.Response.Clear() first to empty the response and set the StatusCode to 200: