HttpWebRequest 构造函数

定义

初始化 HttpWebRequest 类的新实例。Initializes a new instance of the HttpWebRequest class. 这些构造函数已过时;请参阅“备注”部分,了解详细信息。These constructors are obsolete; see the Remarks section for details.

重载

HttpWebRequest()

初始化 HttpWebRequest 类的新实例。Initializes a new instance of the HttpWebRequest class. 此构造函数已过时。This constructor is obsolete.

HttpWebRequest(Uri)
HttpWebRequest(SerializationInfo, StreamingContext)

HttpWebRequestSerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。Initializes a new instance of the HttpWebRequest class from the specified instances of the SerializationInfo and StreamingContext classes. 此构造函数已过时。This constructor is obsolete.

注解

这两个 HttpWebRequest 构造函数已过时,不应使用。Both HttpWebRequest constructors are obsolete and should not be used. 调用 WebRequest.CreateHttp 方法来初始化新的 HttpWebRequest 对象。Call the WebRequest.CreateHttp method to initialize new HttpWebRequest objects.

HttpWebRequest()

警告

此 API 现已过时。

初始化 HttpWebRequest 类的新实例。Initializes a new instance of the HttpWebRequest class. 此构造函数已过时。This constructor is obsolete.

public:
 HttpWebRequest();
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public HttpWebRequest ();
Public Sub New ()
属性

HttpWebRequest(Uri)

public:
 HttpWebRequest(Uri ^ uri);
public HttpWebRequest (Uri uri);
new System.Net.HttpWebRequest : Uri -> System.Net.HttpWebRequest

参数

uri
Uri

HttpWebRequest(SerializationInfo, StreamingContext)

警告

此 API 现已过时。

HttpWebRequestSerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。Initializes a new instance of the HttpWebRequest class from the specified instances of the SerializationInfo and StreamingContext classes. 此构造函数已过时。This constructor is obsolete.

protected:
 HttpWebRequest(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
[System.Obsolete("Serialization is obsoleted for this type.  http://go.microsoft.com/fwlink/?linkid=14202")]
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("Serialization is obsoleted for this type.  https://go.microsoft.com/fwlink/?linkid=14202")]
[System.Obsolete("Serialization is obsoleted for this type.  https://go.microsoft.com/fwlink/?linkid=14202")]
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("Serialization is obsoleted for this type.  https://go.microsoft.com/fwlink/?linkid=14202")]
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("Serialization is obsoleted for this type", false)]
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest

参数

serializationInfo
SerializationInfo

包含序列化新 HttpWebRequest 对象所需信息的 SerializationInfo 对象。A SerializationInfo object that contains the information required to serialize the new HttpWebRequest object.

streamingContext
StreamingContext

包含与新 HttpWebRequest 对象关联的序列化流的源和目标的 StreamingContext 对象。A StreamingContext object that contains the source and destination of the serialized stream associated with the new HttpWebRequest object.

属性

注解

使用序列化时,应用程序必须在完全信任模式下运行。An application must run in full trust mode when using serialization.

另请参阅

适用于