title: Using a backslash (%5c) in a REST WCF URL
body: <p>I am building a REST service on WCF, and one of the methods I am writing is GetProfile, which will return the profile for a given username. The username will include the user's domain, and so will have the following format: "DOMAIN\username".</p>
  
  <p>I therefore have a service called Profiles.svc, which has the following endpoint set up:</p>
  
  <pre><code>[OperationContract]
  [WebGet(UriTemplate = "/{username}", ResponseFormat = WebMessageFormat.Xml)]
  IRestResponse GetProfile(String username);
  </code></pre>
  
  <p>However, when I attempt to visit the service at <a href="http://server/profiles.svc/DOMAIN%5cusername" rel="nofollow noreferrer">http://server/profiles.svc/DOMAIN%5cusername</a> (%5c is the urlencoded form of a backslash) I get the following error:</p>
  
  <pre>Server error in '/' Application
  HTTP Error 400 - Bad Request</pre>
  
  <p>This occurs even when there is no code actually defined in my implementation of GetProfile, so I believe the error is being thrown at the point WCF attempts to bind the URI to a method.</p>
  
  <p>Are there some settings I need to add to my web service configuration in order to allow backslashes to be added to URLs in a REST WCF service? Or are backslashes simply not allowed?</p>