Mono Class Library: System.Net.WebClient Overview | Members

System.Net.WebClient.OpenWrite Method

Opens a System.IO.Stream for writing data to the resource identified by the specified URI using the specified protocol method. [Edit]

public System.IO.Stream OpenWrite (string address, string method)

Parameters

address
A string that specifies the URI of the resource to receive the data. [Edit]
method
A string that specifies the protocol method used to send the data to the resource identified by address . [Edit]

Returns

A System.IO.Stream used to write data to the resource. [Edit]

Exceptions

TypeReason
System.Net.WebException

The absolute URI is not valid.

-or-

An error occurred while opening the stream.

[Edit]

Remarks

If the WebClient.BaseAddress property of the current instance is not string.Empty, address is combined with WebClient.BaseAddress to form the absolute URI of the requested data. If the WebClient.BaseAddress property of the current instance is string.Empty, address is required to be the absolute URI of the requested data. If the WebClient.QueryString property of the current instance is not string.Empty, it is appended to address.

Note:

This method returns a writable stream that is used to send data to a resource. The underlying request is made with the protocol method specified by method . For more information about protocol methods, see WebRequest.Method .

If the method parameter specifies a method that is not recognized by the server, the underlying protocol classes determine what occurs. Typically, a System.Net.WebException is thrown with the WebException.Status property set to indicate the error.

[Edit]

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0