I\'ve seen so many implementations of sending an http post, and admittedly I don\'t fully understand the underlying details to know what\'s required.
What is the
As others have said, WebClient.UploadString
(or UploadData
) is the way to go.
However the built-in WebClient
has a major drawback : you have almost no control over the WebRequest
that is used behind the scene (cookies, authentication, custom headers...). A simple way to solve that issue is to create your custom WebClient
and override the GetWebRequest
method. You can then customize the request before it is sent (you can do the same for the response by overridingGetWebResponse
). Here is an example of a cookie-aware WebClient
. It's so simple it makes me wonder why the built-in WebClient doesn't handle it out-of-the-box...