2 Replies Latest reply on Apr 25, 2018 9:37 PM by Osvin Osvin

    TrustedTicketServiceImpl - Invalid request host: ::1.

    Osvin Osvin

      I am developing an application using Asp.net MVC using Visual Studio 2017. I am struggling with a problem.
      I am trying to get ticket but all i get response is -1. My code is


                 WebRequest req = System.Net.WebRequest.Create("http://localhost:8000/trusted");

                  req.ContentType = "application/x-www-form-urlencoded";

                  req.Method = "POST";

                  byte[] bytes = System.Text.Encoding.ASCII.GetBytes("username=usernamehere");

                  req.ContentLength = bytes.Length;

                  System.IO.Stream os = req.GetRequestStream();

                  os.Write(bytes, 0, bytes.Length); //Push it out there


                  System.Net.WebResponse resp = req.GetResponse();

                  if (resp == null) return null;

                  System.IO.StreamReader sr =

                        new System.IO.StreamReader(resp.GetResponseStream());

                  var response = sr.ReadToEnd().Trim();

      I have tried every method and double checked my trusted hosts.
      I have two trusted hosts one is my private IP and other is my adjacent Computer's private IP. I tried to send request using both but with both response is -1.
      Please help me.