I have a WCF Web Api Restful webservice.
I want every single service call to take an optional parameters: suppress_status_codes. Is there a way to do this wihtout adding the parameter and handling to every end point like:
[WebGet(UriTemplate = "{somearg1}/{somearg2}/?supress={suppressStatusCodes}")
public HttpResponseMessage<string> SomeEndPoint(string somearg1, long somearg2, bool suppressStatusCodes)
{
// handle suppress status codes
// do rest of call
The purpose of suppress_status_code is for Flash integration. If a webservice returns anything other than a 200 flash has an impossible timie processing the message body so I need to be able to return a "200" with an error and error status code in the HttpResponseMessage if supress_status_codes is true.
Twitter's api has an identical optional parameter for this reason.