RESTful web services, .NET framework and many HTTP methods

Recently, I decided that the client / server application I created (where the client is a Windows Mobile device running .netcf 3.5), ideally, would use a lightweight web service, oriented approximately to the principles of REST.

Is there a way (and if so, which is the easiest way) to implement the most common HTTP methods using the .net compact framework. In particular, we hope 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 not sure about the other methods.

Thanks in advance.

+3
source share
2 answers

Yes, HttpWebRequest can be used to execute all standard HTTP verbs. Actually, the Method property is just a string, so you can even use non-standard ones. Not that I recommend you do this, but it allows you to play with verbs like "PATCH", which at some point can become standard.

+3
source

Thanks for the answer. In the end, I came across this MSDN article regarding creating simple (custom) HTTP connections using the .NET framework:

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

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

+2
source

Source: https://habr.com/ru/post/1716544/


All Articles