HTTP Client Request with headers and POST in DotNet?
in Java I have a HTTPClient which use Headers in a POST Method with a website to send a request and get a answer.
With which component I ca开发者_StackOverflow社区n do that in C#.net?
How about HttpWebRequest
.
If you mean, "what is the equivalent way of writing a simple http client in C#?", then you have a few options.
The most obvious is the System.Net.WebClient
class. This is a nice and simple, easy to use, web client that provides functionality for the most common web operations.
If you wanted to go a little deeper, then the System.Net.HttpWebRequest
and System.Net.HttpWebResponse
classes give you access to lower level workings of http web requests and responses.
精彩评论