HttpVersion HttpVersion HttpVersion HttpVersion Class

Definition

Definiert die von der HttpWebRequest-Klasse und der HttpWebResponse-Klasse unterstützten HTTP-Versionsnummern.Defines the HTTP version numbers that are supported by the HttpWebRequest and HttpWebResponse classes.

public ref class HttpVersion
public class HttpVersion
type HttpVersion = class
Public Class HttpVersion
Vererbung
HttpVersionHttpVersionHttpVersionHttpVersion

Beispiele

Das folgende Beispiel veranschaulicht die Verwendung von HttpVersion.The following example demonstrates the use of HttpVersion.

// Create a 'HttpWebRequest' object.
HttpWebRequest^ myHttpWebRequest = (HttpWebRequest^)( WebRequest::Create( "http://www.microsoft.com" ) );
Console::WriteLine( "\nThe 'ProtocolVersion' of the protocol before assignment is : {0}", myHttpWebRequest->ProtocolVersion );
// Assign Version10 to ProtocolVersion.
myHttpWebRequest->ProtocolVersion = HttpVersion::Version10;
// Assign the response Object* of 'HttpWebRequest' to a 'HttpWebResponse' variable.
HttpWebResponse^ myHttpWebResponse = (HttpWebResponse^)( myHttpWebRequest->GetResponse() );
Console::WriteLine( "\nThe 'ProtocolVersion' of the protocol after  assignment is : {0}", myHttpWebRequest->ProtocolVersion );
Console::WriteLine( "\nThe 'ProtocolVersion' of the response Object* is : {0}", myHttpWebResponse->ProtocolVersion );
// Create a 'HttpWebRequest' object.
HttpWebRequest myHttpWebRequest=(HttpWebRequest)WebRequest.Create("http://www.microsoft.com");
Console.WriteLine("\nThe 'ProtocolVersion' of the protocol before assignment is :{0}",myHttpWebRequest.ProtocolVersion);
// Assign Version10 to ProtocolVersion.
myHttpWebRequest.ProtocolVersion=HttpVersion.Version10;
// Assign the response object of 'HttpWebRequest' to a 'HttpWebResponse' variable.
HttpWebResponse myHttpWebResponse=(HttpWebResponse)myHttpWebRequest.GetResponse();
Console.WriteLine("\nThe 'ProtocolVersion' of the protocol after  assignment is :{0}",myHttpWebRequest.ProtocolVersion);
Console.WriteLine("\nThe 'ProtocolVersion' of the response object is :{0}",myHttpWebResponse.ProtocolVersion);
' Create a 'HttpWebRequest' object.
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create("http://www.microsoft.com"), HttpWebRequest)
Console.WriteLine(ControlChars.Cr + "The 'ProtocolVersion' of the protocol before assignment is :{0}", myHttpWebRequest.ProtocolVersion)
' Assign Version10 to ProtocolVersion.
myHttpWebRequest.ProtocolVersion = HttpVersion.Version10
' The response object of 'HttpWebRequest' is assigned to a 'HttpWebResponse' variable.
Dim myHttpWebResponse As HttpWebResponse = CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
Console.WriteLine(ControlChars.Cr + "The 'ProtocolVersion' of the protocol after  assignment is :{0}", myHttpWebRequest.ProtocolVersion)
Console.WriteLine(ControlChars.Cr + "The 'ProtocolVersion' of the response object is :{0}", myHttpWebResponse.ProtocolVersion)

Hinweise

Die HttpVersion -Klasse definiert, die HTTP-Versionen, die von Microsoft Intune die HttpWebRequest und HttpWebResponse Klassen.The HttpVersion class defines the HTTP versions that are supported by the HttpWebRequest and HttpWebResponse classes. Die HTTP-Versionsnummer wird verwendet, um versionsspezifische Features von HTTP, z. B. pipelining und Segmentierung zu steuern.The HTTP version number is used to control version-specific features of HTTP, such as pipelining and chunking.

Konstruktoren

HttpVersion() HttpVersion() HttpVersion() HttpVersion()

Initialisiert eine neue Instanz der HttpVersion-Klasse.Initializes a new instance of the HttpVersion class.

Felder

Unknown Unknown Unknown Unknown
Version10 Version10 Version10 Version10

Definiert eine Version-Instanz für HTTP 1.0.Defines a Version instance for HTTP 1.0.

Version11 Version11 Version11 Version11

Definiert eine Version-Instanz für HTTP 1.1.Defines a Version instance for HTTP 1.1.

Version20 Version20 Version20 Version20

Methoden

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Bestimmt, ob das angegebene Objekt mit dem aktuellen Objekt identisch ist.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Fungiert als Standardhashfunktion.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Ruft den Type der aktuellen Instanz ab.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.Returns a string that represents the current object.

(Inherited from Object)

Gilt für: