HttpVersion HttpVersion HttpVersion HttpVersion Class

Definición

Define los números de versión de HTTP admitidos por las clases HttpWebRequest y HttpWebResponse.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
Herencia
HttpVersionHttpVersionHttpVersionHttpVersion

Ejemplos

El siguiente ejemplo muestra el uso de 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)

Comentarios

El HttpVersion clase define las versiones HTTP que son compatibles con el HttpWebRequest y HttpWebResponse clases.The HttpVersion class defines the HTTP versions that are supported by the HttpWebRequest and HttpWebResponse classes. El número de versión HTTP se utiliza para controlar las características específicas de la versión de HTTP, como la canalización y fragmentación.The HTTP version number is used to control version-specific features of HTTP, such as pipelining and chunking.

Constructores

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

Inicializa una nueva instancia de la clase HttpVersion.Initializes a new instance of the HttpVersion class.

Campos

Unknown Unknown Unknown Unknown
Version10 Version10 Version10 Version10

Define una instancia de Version para HTTP 1,0.Defines a Version instance for HTTP 1.0.

Version11 Version11 Version11 Version11

Define una instancia de Version para HTTP 1.1.Defines a Version instance for HTTP 1.1.

Version20 Version20 Version20 Version20

Métodos

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

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

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

Sirve como la función hash predeterminada.Serves as the default hash function.

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

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

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

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

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

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a