public void Process(HttpListenerRequest request, HttpListenerResponse response)
{
try
{
if (request.HttpMethod != "GET")
{
response.StatusCode = 405;
response.StatusDescription = "Method Not Supported";
response.Close();
return;
}
string version = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion;
string status = GetStatusDescription();
string timestamp = DateTime.UtcNow.ToString("s", CultureInfo.InvariantCulture) + "Z";
FormatJsonResponse(response, version, status, timestamp);
}
catch (HttpListenerException hlex)
{
Supervisor.LogException(hlex, TraceEventType.Error, request.RawUrl);
response.StatusCode = 500;
response.StatusDescription = "Error Occurred";
response.Close();
}
}