title: How to implement Delete service call using ServiceStack
body: <p>I have couple of questions related to REST service implementation using ServiceStack. </p>
  
  <ol>
  <li><p>For GET operation, I define my request DTO as below :</p>
  
  <pre><code>[Route("/Customer/{ID}", Verbs = "GET")]
  public class GetCustomer : IReturn&lt;GetCustomerResponse&gt;
  {
      ....
      ....
  }
  </code></pre></li>
  </ol>
  
  <p>Here "GetCustomer" is request DTO and "GetCustomerResponse" is response DTO. But for PUT/POST/DELETE operation, I just need to know whether operation got committed successfully or not and if 'not' then what is the exception. So what should be my request dto definition for POST/PUT/DELETE? Should it use IReturnVoid as shown below?</p>
  
  <pre><code>[Route("/Customer/{ID}", Verbs = "DELETE")]
  public class DeleteCustomer : IReturnVoid
  {
      ....
      ....
  }
  </code></pre>
  
  <p>If I have to use IReturnVoid then how I can retrieve any exception information that might occur on committing my operation?</p>
  
  <p>In the error handling document for service stack it is written and I quote below </p>
  
  <blockquote>
    <p>Error Response Types</p>
    
    <p>The Error Response that gets returned when an Exception is thrown
    varies on whether a conventionally-named {RequestDto}Response DTO
    exists or not.</p>
    
    <p>If it exists:</p>
    
    <p>The {RequestDto}Response is returned, regardless of the service
    method's response type. If the {RequestDto}Response DTO has a
    ResponseStatus property, it is populated otherwise no ResponseStatus
    will be returned. (If you have decorated the {ResponseDto}Response
    class and properties with [DataContract]/[DataMember] attributes, then
    ResponseStatus also needs to be decorated, to get populated).</p>
    
    <p>Otherwise, if it doesn't:</p>
    
    <p>A generic ErrorResponse gets returned with a populated ResponseStatus
    property.</p>
    
    <p>The Service Clients transparently handles the different Error Response
    types, and for schema-less formats like JSON/JSV/etc there's no actual
    visible difference between returning a ResponseStatus in a custom or
    generic ErrorResponse - as they both output the same response on the
    wire.</p>
  </blockquote>
  
  <p>What I'm not getting from above is what should be the return type for my Delete method in my service implementation? How I can implement my delete method without defining delete response DTO but yet I'm able to retrieve 'ErrorResponse' n exception info?</p>
  
  <ol start="2">
  <li>Is it possible to define route with "DELETE" verb? I have following implementation. </li>
  </ol>
  
  <p><strong>Route:</strong></p>
  
  <pre><code>[Route("/DeleteCustomer/{ID}", Verbs = "DELETE")]
  public class DeleteCustomer : IReturn&lt;DeleteCustomerResponse&gt;
  {
      public int ID { get; set; }
  }
  </code></pre>
  
  <p><strong>Method implementation:</strong></p>
  
  <pre><code>public DeleteContactResponse Delete(DeleteContact request)
  {
      .....
  }
  </code></pre>
  
  <p>But whenever I call this delete using my client, I always get "NotFound" exception. I tried different clients but with all I get 404 error. </p>
  
  <p>One of the <a href="http://blogs.askcts.com/2014/05/15/getting-started-with-servicestack-part-3/" rel="nofollow noreferrer">reference link</a> available alongwith Servicestack document reuses the "GET" and "DELETE" verb together. </p>
  
  <p>Another <a href="https://stackoverflow.com/questions/12711522/servicestack-route-design">link</a> suggests not all browsers support delete operation. </p>
  
  <p>So I wonder how Delete operation should be implemented? </p>