RESTful web services, .net compact framework, and the many HTTP methods

compact-frameworkrestwindows-mobile

I have recently decided that a client/server application I am building (where the client is a Windows Mobile device running .netcf 3.5) would, ideally, utilise a lightweight web service conforming roughly to the principles of REST.

Is there a way (and if so what is the easiest way) to implement the most common HTTP methods using the .net compact framework. Specifically, we are hoping to use GET, POST, PUT, and DELETE.

I see that HTTPWebRequest can be used to perform POST operations (using request.Method = "POST"), but I'm unsure on the other methods.

Thanks in advance.

Best Answer

Yes, HttpWebRequest can be used to perform all of the standard HTTP verbs. In fact the Method property is just a string so you can even use non-standard ones too. Not that I recommending you do that, but it does allow you to play around with verbs like "PATCH" which may become a standard at some point.