title: REST webservice "Bad request"
body: <p>I'm writing a REST webservice having a method like this:</p>
  
  <pre><code>[WebGet(
      UriTemplate = "/Test/{p1}/{p2}",
      BodyStyle = WebMessageBodyStyle.Bare,
      ResponseFormat = WebMessageFormat.Xml)]
  public string Test(string p1, string p2)
  {
      // Do something here
  }
  </code></pre>
  
  <p>So if I call <code>basurl/Test/prova/test</code> my method <code>Test</code> is invoked with <em>p1="prova"</em> and <em>p2="test"</em> and everything works fine.<br>
  Problem comes when I try to use a param having (for example) <strong>%</strong> char: even translating it in URL code, when I try to call <code>basurl/Test/prova/te%25st</code> I get a<br>
  Errore HTTP 400 - Bad Request.</p>
  
  <p>If I use</p>
  
  <pre><code>[WebGet(
      UriTemplate = "/Test/{p1}?p2={p2}",
      BodyStyle = WebMessageBodyStyle.Bare,
      ResponseFormat = WebMessageFormat.Xml)]
  public string Test(string p1, string p2)
  {
      // Do something here
  }
  </code></pre>
  
  <p>and call <code>basurl/Test/prova?p2=te%25st</code> it works.<br>
  Why? What can I do to let first syntax work?</p>
  
  <p><strong>UPDATE:</strong><br>
  Look at my answer with a possible solution.<br>
  If someone finds a better one, please post it!!<br>
  Thanks</p>