title: How can I use HttpListener when the url doesn't have ending by "/"?
body: <p>I want to get listen to a url for getting some information. so my code is this:</p>
  
  <pre><code>public static void SimpleListenerExample(string[] prefixes)
  {
      HttpListener listener = new HttpListener();
      // Add the prefixes. 
      foreach (string s in prefixes)
      {
          listener.Prefixes.Add(s);
      }
      listener.Start();
      //Console.WriteLine("Listening...");
      // Note: The GetContext method blocks while waiting for a request. 
      HttpListenerContext context = listener.GetContext();
      HttpListenerRequest request = context.Request;
      // Obtain a response object.
      HttpListenerResponse response = context.Response;
      // Construct a response. 
      string responseString = "&lt;HTML&gt;&lt;BODY&gt; Hello world!&lt;/BODY&gt;&lt;/HTML&gt;";
      byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
      // Get a response stream and write the response to it.
      response.ContentLength64 = buffer.Length;
      System.IO.Stream output = response.OutputStream;
      output.Write(buffer, 0, buffer.Length);
      // You must close the output stream.
      output.Close();
      listener.Stop();
  }
  
  private void button2_Click(object sender, EventArgs e)
  {
      string[] test = { "http://xxx.xxxx.xxx.xxx:8086/sms.html" };
      SimpleListenerExample(test);
  }
  </code></pre>
  
  <p>The URL that I want to add as a prefix, has not ending by "/". and if I add it at the end of url, its not valid and doesn't work.</p>
  
  <p>so how can I listen to a url that it doesn't have ending by "/" ??</p>