title: How to make HTTP PUT and DELETE work in Silverlight 4
body: <p>I would prefer to avoid getting into a debate about whether HTTP verbs PUT and DELETE are appropriate or obsolete and focus on the question of actually making Silverlight work when "forced" to use these verbs.</p>
  
  <p>I am trying to create a Silverlight 4 client application that calls an existing REST web service that has operations for the PUT and DELETE verbs.  This service is not going to change.</p>
  
  <p>I've added the following statement into constructor in my App.xaml.cs:</p>
  
  <pre><code>WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
  </code></pre>
  
  <p>The service has a clientaccesspolicy.xml file that contains:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;access-policy&gt;
    &lt;cross-domain-access&gt;
      &lt;policy&gt;
        &lt;allow-from http-request-headers="*"&gt;
          &lt;domain uri="*"/&gt;
        &lt;/allow-from&gt;
        &lt;grant-to&gt;
          &lt;resource path="/" include-subpaths="true"/&gt;
        &lt;/grant-to&gt;
      &lt;/policy&gt;
    &lt;/cross-domain-access&gt;
  &lt;/access-policy&gt;
  </code></pre>
  
  <p>I am using the WebClient class to handle GET and POST requests.  When I attempt to do the same with PUT or DELETE for the verb/method, I get an ambiguous "security error" which led me to adding the statement above.</p>
  
  <p>I've seen various posts and blog articles talking about using HttpWebRequest to get around this but have not found one that actually SHOWS HOW to make these (asynchronous) calls from a Silverlight client.</p>
  
  <p>If there is something wrong with the code above, please let me know.  Otherwise, if you can show me or point me to an example demonstrating how these requests can be implemented, I'd greatly appreciate the help.</p>