I'm using CouchDB as a data source for a C# web service.
Being RESTful, CouchDB passes back a status code of 404 when asked for a document that does not exist. The standard .NET web request wants to throw an exception at this but (to me, at least) communicating that a data source has returned "no results" via an exception is utterly horrible; and it's a stink I really don't want wafting around in my code...
Is there any replacement for WebRequest I can use that will allow me to deal with status codes as I see fit?
EDIT: Just to clarify, due to the responses I've had so far: I do not want to hide the exception that WebRequest throws. I am looking for an alternative to the standard WebRequest that does not throw exceptions based on status codes as .NET's interpretation of what constitutes an error doesn't seem in-line with REST principles.
EDIT #2 I really need a 3.5 compatible way of doing this; sorry for not being specific about that at the start.