Rebex
Products Downloads Buy Support Contact
Show / Hide Table of Contents

WebClient Class

Namespace: Rebex.Net
Assembly: Rebex.Http.dll (version 7.0.9119)

Provides simple methods to upload and download data from HTTP/HTTPS servers.

Syntax
public class WebClient : IDisposable
Inheritance
Object
WebClient
Implements
IDisposable
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()

Constructors

Name Description
WebClient()

Initializes a new instance of the WebClient class.

WebClient(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.

Properties

Name Description
BaseAddress

Gets or sets the base address to simplify multiple requests to one server.

Credentials

Get or sets network credentials to identify a user.

Encoding

Gets or sets the encoding to be used for string upload and download.

Headers

Get or sets a collection of HTTP headers to send with a request.

LogWriter

Gets or sets the LogWriter used by this object.

Proxy

Gets or sets the network proxy to use to access a remote server.

QueryString

Gets or sets the collection of name-value pairs, which will be added into the request's query.

ResponseHeaders

Gets or sets a collection of HTTP headers associated with the response.

Settings

Gets TLS/SSL settings.

Timeout

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).

Methods

Name Description
Cancel()

Cancels all currently running requests.

Dispose()

Disposes the WebClient object.

DownloadData(String)

Downloads data from provided URI.

DownloadData(Uri)

Downloads data from provided URI.

DownloadDataAsync(String, Object)

Begins asynchronous DownloadData operation. Downloads data from provided URI.

DownloadDataAsync(Uri, Object)

Begins asynchronous DownloadData operation. Downloads data from provided URI.

DownloadFile(String, String)

Downloads data from provided URI and save them to the file.

DownloadFile(Uri, String)

Downloads data from provided URI and save them to the file.

DownloadFileAsync(String, String, Object)

Begins asynchronous DownloadFile operation. Downloads data from provided URI and save them to the file.

DownloadFileAsync(Uri, String, Object)

Begins asynchronous DownloadFile operation. Downloads data from provided URI and save them to the file.

DownloadString(String)

Downloads a resource from provided URI as a string.

DownloadString(Uri)

Downloads a resource from provided URI as a string.

DownloadStringAsync(String, Object)

Begins asynchronous DownloadString operation. Downloads a resource from provided URI as a string.

DownloadStringAsync(Uri, Object)

Begins asynchronous DownloadString operation. Downloads a resource from provided URI as a string.

GetHeaders(String)

Downloads headers for provided URI using HEAD request.

GetHeaders(Uri)

Downloads headers for provided URI using HEAD request.

GetHeadersAsync(String, Object)

Begins asynchronous GetHeaders operation. Downloads headers for provided URI using HEAD request.

GetHeadersAsync(Uri, Object)

Begins asynchronous GetHeaders operation. Downloads headers for provided URI using HEAD request.

OpenRead(String)

Opens a stream that contains data retrieved from provided URI.

OpenRead(Uri)

Opens a stream that contains data retrieved from provided URI.

OpenReadAsync(String, Object)

Begins asynchronous OpenRead operation. Opens a stream that contains data retrieved from provided URI.

OpenReadAsync(Uri, Object)

Begins asynchronous OpenRead operation. Opens a stream that contains data retrieved from provided URI.

OpenWrite(String)

Opens a stream that is used to send data to provided URI.

OpenWrite(String, String)

Opens a stream that is used to send data to provided URI.

OpenWrite(Uri)

Opens a stream that is used to send data to provided URI.

OpenWrite(Uri, String)

Opens a stream that is used to send data to provided URI.

OpenWriteAsync(String, Object)

Begins asynchronous OpenWrite operation. Opens a stream that is used to send data to provided URI.

OpenWriteAsync(String, String, Object)

Begins asynchronous OpenWrite operation. Opens a stream that is used to send data to provided URI.

OpenWriteAsync(Uri, Object)

Begins asynchronous OpenWrite operation. Opens a stream that is used to send data to provided URI.

OpenWriteAsync(Uri, String, Object)

Begins asynchronous OpenWrite operation. Opens a stream that is used to send data to provided URI.

SetSocketFactory(ISocketFactory)

Sets the socket factory to be used to create communication sockets.

UploadData(String, Byte[])

Uploads a data to provided URI and returns a response data of the upload operation.

UploadData(String, String, Byte[])

Uploads a data to provided URI and returns a response data of the upload operation.

UploadData(Uri, Byte[])

Uploads a data to provided URI and returns a response data of the upload operation.

UploadData(Uri, String, Byte[])

Uploads a data to provided URI and returns a response data of the upload operation.

UploadDataAsync(String, Byte[], Object)

Begins asynchronous UploadData operation. Uploads a data to provided URI and returns a response data of the upload operation.

UploadDataAsync(String, String, Byte[], Object)

Begins asynchronous UploadData operation. Uploads a data to provided URI and returns a response data of the upload operation.

UploadDataAsync(Uri, Byte[], Object)

Begins asynchronous UploadData operation. Uploads a data to provided URI and returns a response data of the upload operation.

UploadDataAsync(Uri, String, Byte[], Object)

Begins asynchronous UploadData operation. Uploads a data to provided URI and returns a response data of the upload operation.

UploadFile(String, String)

Uploads a file to provided URI and returns a response data of the upload operation.

UploadFile(String, String, String)

Uploads a data to provided URI and returns a response data of the upload operation.

UploadFile(Uri, String)

Uploads a data to provided URI and returns a response data of the upload operation.

UploadFile(Uri, String, String)

Uploads a data to provided URI and returns a response data of the upload operation.

UploadFileAsync(String, String, Object)

Begins asynchronous UploadFile operation. Uploads a file to provided URI and returns a response data of the upload operation.

UploadFileAsync(String, String, String, Object)

Begins asynchronous UploadFile operation. Uploads a data to provided URI and returns a response data of the upload operation.

UploadFileAsync(Uri, String, Object)

Begins asynchronous UploadFile operation. Uploads a data to provided URI and returns a response data of the upload operation.

UploadFileAsync(Uri, String, String, Object)

Begins asynchronous UploadFile operation. Uploads a data to provided URI and returns a response data of the upload operation.

UploadString(String, String)

Uploads a string to provided URI as a new resource.

UploadString(String, String, String)

Uploads a string to provided URI as a new resource.

UploadString(Uri, String)

Uploads a string to provided URI as a new resource.

UploadString(Uri, String, String)

Uploads a string to provided URI as a new resource.

UploadStringAsync(String, String, Object)

Begins asynchronous UploadString operation. Uploads a string to provided URI as a new resource.

UploadStringAsync(String, String, String, Object)

Begins asynchronous UploadString operation. Uploads a string to provided URI as a new resource.

UploadStringAsync(Uri, String, Object)

Begins asynchronous UploadString operation. Uploads a string to provided URI as a new resource.

UploadStringAsync(Uri, String, String, Object)

Begins asynchronous UploadString operation. Uploads a string to provided URI as a new resource.

UploadValues(String, NameValueCollection)

Uploads a name/value collection to a specified URI.

UploadValues(String, String, NameValueCollection)

Uploads a name/value collection to a specified URI.

UploadValues(Uri, NameValueCollection)

Uploads a name/value collection to a specified URI.

UploadValues(Uri, String, NameValueCollection)

Uploads a name/value collection to a specified URI.

UploadValuesAsync(String, NameValueCollection, Object)

Begins asynchronous UploadValues operation. Uploads a name/value collection to a specified URI.

UploadValuesAsync(String, String, NameValueCollection, Object)

Begins asynchronous UploadValues operation. Uploads a name/value collection to a specified URI.

UploadValuesAsync(Uri, NameValueCollection, Object)

Begins asynchronous UploadValues operation. Uploads a name/value collection to a specified URI.

UploadValuesAsync(Uri, String, NameValueCollection, Object)

Begins asynchronous UploadValues operation. Uploads a name/value collection to a specified URI.

Events

Name Description
DownloadProgressChanged

Occurs when download progress has changed.

UploadProgressChanged

Occurs when upload progress has changed.

ValidatingCertificate

Occurs when a server certificate needs to be validated.

In This Article
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies