HttpWebRequest 构造函数

定义

初始化 HttpWebRequest 类的新实例。 这些构造函数已过时;有关详细信息,请参阅“备注”部分。

重载

名称 说明
HttpWebRequest()
已过时.
已过时.

初始化 HttpWebRequest 类的新实例。 此构造函数已过时。

HttpWebRequest(SerializationInfo, StreamingContext)
已过时.
已过时.
已过时.
已过时.

从类的HttpWebRequest指定实例初始化类的新实例SerializationInfoStreamingContext。 此构造函数已过时。

注解

Caution

WebRequestHttpWebRequestServicePointWebClient 已过时,不应将其用于新开发。 改用 HttpClient

这两 HttpWebRequest 个构造函数都已过时,不应使用。 WebRequest.CreateHttp调用该方法以初始化新HttpWebRequest对象。

HttpWebRequest()

注意

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

注意

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

初始化 HttpWebRequest 类的新实例。 此构造函数已过时。

public:
 HttpWebRequest();
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
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(SerializationInfo, StreamingContext)

Source:
HttpWebRequest.cs
Source:
HttpWebRequest.cs
Source:
HttpWebRequest.cs
Source:
HttpWebRequest.cs
Source:
HttpWebRequest.cs

注意

WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.

注意

Serialization is obsoleted for this type. https://go.microsoft.com/fwlink/?linkid=14202

注意

WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead

注意

Serialization is obsoleted for this type. http://go.microsoft.com/fwlink/?linkid=14202

从类的HttpWebRequest指定实例初始化类的新实例SerializationInfoStreamingContext。 此构造函数已过时。

protected:
 HttpWebRequest(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
[System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
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);
[System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
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);
protected HttpWebRequest(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[<System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
[<System.Obsolete("Serialization is obsoleted for this type.  https://go.microsoft.com/fwlink/?linkid=14202")>]
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
[<System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
[<System.Obsolete("Serialization is obsoleted for this type.  http://go.microsoft.com/fwlink/?linkid=14202")>]
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

参数

serializationInfo
SerializationInfo

包含 SerializationInfo 序列化新 HttpWebRequest 对象所需的信息的对象。

streamingContext
StreamingContext

一个 StreamingContext 对象,该对象包含与新 HttpWebRequest 对象关联的序列化流的源和目标。

属性

注解

使用序列化时,应用程序必须以完全信任模式运行。

另请参阅

适用于