URLSession class
A client that can make network requests to a server.
See NSURLSession
Constructors
- URLSession.sessionWithConfiguration(URLSessionConfiguration config, {URLRequest? onRedirect(URLSession session, URLSessionTask task, HTTPURLResponse response, URLRequest newRequest)?, URLSessionResponseDisposition onResponse(URLSession session, URLSessionTask task, URLResponse response)?, void onData(URLSession session, URLSessionTask task, Data error)?, void onFinishedDownloading(URLSession session, URLSessionDownloadTask task, Uri uri)?, void onComplete(URLSession session, URLSessionTask task, Error? error)?})
-
A client with a given configuration.
factory
-
A client with reasonable default behavior.
factory
Properties
- configuration → URLSessionConfiguration
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dataTaskWithCompletionHandler(
URLRequest request, void completion(Data? data, HTTPURLResponse? response, Error? error)) → URLSessionTask -
Creates a URLSessionTask that accesses a server URL and calls
completionwhen done. -
dataTaskWithRequest(
URLRequest request) → URLSessionTask -
downloadTaskWithRequest(
URLRequest request) → URLSessionDownloadTask - Creates a URLSessionDownloadTask that downloads the data from a server URL.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited