The ultimate WCF Service contract

Published on May 8, 2008

 

[ServiceContract]
public interface IRESTService {
 
[OperationContract]
[WebInvoke(Method = "GET",UriTemplate = "*")]
Stream Get();
 
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "*")]
Stream Post(Stream body);
 
 
[OperationContract]
[WebInvoke(Method = "PUT", UriTemplate = "*")]
Stream Put(Stream body);
 
 
[OperationContract]
[WebInvoke(Method = "DELETE", UriTemplate = "*")]
Stream Delete();
}