FileWebRequest.Method Property

Definition

Gets or sets the protocol method used for the request. This property is reserved for future use.

C#
public override string Method { get; set; }

Property Value

The protocol method to use in this request.

Exceptions

The method is invalid.

-or-

The method is not supported.

-or-

Multiple methods were specified.

Examples

The following code example sets the protocol method used for the request. Refer to the complete example in the FileWebRequest class.

C#
// Create a Uri object.
Uri myUrl = new Uri ("file://" + fileName);

// Create a FileWebRequest object.
myFileWebRequest = (FileWebRequest)WebRequest.CreateDefault (myUrl);

// Set the time-out to the value selected by the user.
myFileWebRequest.Timeout = timeout;

// Set the Method property to POST
myFileWebRequest.Method = "POST";

Remarks

The Method property is currently not used by the FileWebRequest class.

Applies to

Produkt Verzie
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1