pakeha
pakeha

Reputation: 2500

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

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.

Upvotes: 3

Views: 3309

Answers (2)

pakeha
pakeha

Reputation: 2500

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.

Upvotes: 2

Darrel Miller
Darrel Miller

Reputation: 142124

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.

Upvotes: 3

Related Questions