views:

237

answers:

2

Hey all,

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.

+1  A: 

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.

Darrel Miller
+1  A: 

Thanks for the answer. Eventually I ran across this MSDN article regarding the construction of simple (custom) HTTP communications using .net compact framework:

http://msdn.microsoft.com/en-us/library/aa446517.aspx

The example uses an ASP.net server, but the client development is relevant regardless of the server technology that you are using.

pakeha