The WebClient type exposes the following members.

Constructors

  NameDescription
Public methodWebClient()()()()
Initializes a new instance of the WebClient class.
Protected methodWebClient(HttpRequestCreator)
Initializes a new instance of the WebClient class with specified HTTP request creator. This enables sharing keep-alive connections between instances of WebClient and WebRequest. However please note that Settings, LogWriter and ValidatingCertificate properties are shared between all instances as well. This means that changing such property affects behavior of all instances as well.

Methods

  NameDescription
Public methodCancel
Cancels all currently running requests.
Public methodDispose
Disposes the WebClient object.
Public methodDownloadData(String)
Downloads data from provided URI.
Public methodDownloadData(Uri)
Downloads data from provided URI.
Public methodDownloadFile(String, String)
Downloads data from provided URI and save them to the file.
Public methodDownloadFile(Uri, String)
Downloads data from provided URI and save them to the file.
Public methodDownloadString(String)
Downloads a resource from provided URI as a string.
Public methodDownloadString(Uri)
Downloads a resource from provided URI as a string.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type. GetHashCode()()()() is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from Object.)
Public methodGetHeaders(String)
Downloads headers for provided URI using HEAD request.
Public methodGetHeaders(Uri)
Downloads headers for provided URI using HEAD request.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpenRead(String)
Opens a stream that contains data retrieved from provided URI.
Public methodOpenRead(Uri)
Opens a stream that contains data retrieved from provided URI.
Public methodOpenWrite(String)
Opens a stream that is used to send data to provided URI.
Public methodOpenWrite(Uri)
Opens a stream that is used to send data to provided URI.
Public methodOpenWrite(String, String)
Opens a stream that is used to send data to provided URI.
Public methodOpenWrite(Uri, String)
Opens a stream that is used to send data to provided URI.
Public methodSetSocketFactory
Sets the socket factory to be used to create communication sockets.
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodUploadData(String, array<Byte>[]()[][])
Uploads a data to provided URI and returns a response data of the upload operation.
Public methodUploadData(Uri, array<Byte>[]()[][])
Uploads a data to provided URI and returns a response data of the upload operation.
Public methodUploadData(String, String, array<Byte>[]()[][])
Uploads a data to provided URI and returns a response data of the upload operation.
Public methodUploadData(Uri, String, array<Byte>[]()[][])
Uploads a data to provided URI and returns a response data of the upload operation.
Public methodUploadFile(String, String)
Uploads a file to provided URI and returns a response data of the upload operation.
Public methodUploadFile(Uri, String)
Uploads a data to provided URI and returns a response data of the upload operation.
Public methodUploadFile(String, String, String)
Uploads a data to provided URI and returns a response data of the upload operation.
Public methodUploadFile(Uri, String, String)
Uploads a data to provided URI and returns a response data of the upload operation.
Public methodUploadString(String, String)
Uploads a string to provided URI as a new resource.
Public methodUploadString(Uri, String)
Uploads a string to provided URI as a new resource.
Public methodUploadString(String, String, String)
Uploads a string to provided URI as a new resource.
Public methodUploadString(Uri, String, String)
Uploads a string to provided URI as a new resource.
Public methodUploadValues(String, NameValueCollection)
Uploads a name/value collection to a specified URI.
Public methodUploadValues(Uri, NameValueCollection)
Uploads a name/value collection to a specified URI.
Public methodUploadValues(String, String, NameValueCollection)
Uploads a name/value collection to a specified URI.
Public methodUploadValues(Uri, String, NameValueCollection)
Uploads a name/value collection to a specified URI.

Properties

  NameDescription
Public propertyBaseAddress
Gets or sets the base address to simplify multiple requests to one server.
Public propertyCredentials
Get or sets network credentials to identify a user.
Public propertyEncoding
Gets or sets the encoding to be used for string upload and download.
Public propertyHeaders
Get or sets a collection of HTTP headers to send with a request.
Public propertyLogWriter
Gets or sets the LogWriter used by this object.
Public propertyProxy
Gets or sets the network proxy to use to access a remote server.
Public propertyResponseHeaders
Gets or sets a collection of HTTP headers associated with the response.
Public propertySettings
Gets TLS/SSL settings.
Public propertyTimeout
Gets or sets the length of time in milliseconds before the request times out (specify -1 or 0 to indicate that the request does not time out; minimal value is 1000).

Events

  NameDescription
Public eventDownloadProgressChanged
Occurs when download progress has changed.
Public eventUploadProgressChanged
Occurs when upload progress has changed.
Public eventValidatingCertificate
Occurs when a server certificate needs to be validated.

See Also