It seems that HttpWebRequest
has more control like ReadWriteTimeout
. I am wondering whether I should stick with HttpWebRequest
, rather than WebRequest
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
A
WebRequest
can be aHttpWebRequest
/FtpWebRequest
/FileWebRequest
(or more in the future...)I know its too long time but just for information purpose:
WebRequest
The
WebRequest
is an abstract base class. So you actually don't use it directly. You use it through it derived classes -HttpWebRequest
andFileWebRequest
.You use Create method of
WebRequest
to create an instance ofWebRequest
.GetResponseStream
returnsdata stream
.There are also
FileWebRequest
andFtpWebRequest
classes that inherit fromWebRequest
. Normally, you would useWebRequest
to, well, make a request and convert the return to eitherHttpWebRequest
,FileWebRequest
orFtpWebRequest
, depend on your request. Below is an example:Example:
Hope this helps!
WebRequest
is the base/parent class forHttpWebRequest
and some other requests as listed here.For now, they are: