I am currently reviewing some code for colleagues on a different project and they are using a WCF ReST web service.
My concern is that for each of their methods, only the HTTP protocol POST has been specified. This is true whether the actual method is responsible for getting, updating or creating records.
Should web services at all times still adhere to good HTTP protocol standards for information handling? Shouldn't a method such as that below have an HTTP method of "GET" rather than the specified "POST"?
[ServiceContract]
public interface IBranchService
{
[OperationContract]
[WebInvoke(
Method="POST",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
ResponseFormat = WebMessageFormat.Json
)
]
GridResponse GetBranchesAll(string brandCode, string branchNumber);
...
There are no other constraints around the architecture that dictate that only POST should be used.