I do not understand what is wrong. I set up a connection to my server and registered endpoints, but when I request data I get an error 502
namespace Grafana
{
[ApiController]
public class BugsMonitoringController : ControllerBase
{
[HttpGet]
[Route("/")]
public void Empty()
{
}
[HttpPost]
[Route("query")]
public HttpResponseMessage Query()
{
return new HttpResponseMessage()
{
Content = new StringContent("[{\"columns\":[{\"text\":\"Time\",\"type\":\"time\"},{\"text\":\"Country\",\"type\":\"string\"},{\"text\":\"Number\",\"type\":\"number\"}],\"rows\":[[1234567,\"SE\",182],[1234567,\"DE\",282],[1234567,\"US\",382]],\"type\":\"table\"}]", Encoding.UTF8, "application/json")
};
}
[HttpPost]
[Route("search")]
public HttpResponseMessage Search()
{
return new HttpResponseMessage()
{
Content = new StringContent("[ { \"text\" :\"upper_25\", \"value\": 1}, { \"text\" :\"upper_75\", \"value\": 2} ]", Encoding.UTF8, "application/json")
};
}
[HttpPost]
[Route("annotations")]
public HttpResponseMessage Annotation()
{
return new HttpResponseMessage()
{
Content = new StringContent("[{\"text\":\"text shown in body\",\"title\":\"Annotation Title\",\"isRegion\":true,\"time\":\"timestamp\",\"timeEnd\":\"timestamp\",\"tags\":[\"tag1\"]}]", Encoding.UTF8, "application/json")
};
}
}
}
When I send POST request in Postman (maybe this will help to understand the problem):