new
TypeScriptstatic new(): URLSessionSwift declarationclass func new() -> Selfclass · iOS 7.0+ · SDK 27.1
class URLSessionstatic new(): URLSessionSwift declarationclass func new() -> Selfstatic initConfiguration(configuration: URLSessionConfiguration): URLSessionSwift declarationinit(configuration: URLSessionConfiguration)static initConfigurationDelegateDelegateQueue(configuration: URLSessionConfiguration, delegate?: (Implements<URLSessionDelegate> | SDKHandle) | null, queue?: (OperationQueue) | null): URLSessionSwift declarationinit(configuration: URLSessionConfiguration, delegate: (any URLSessionDelegate)?, delegateQueue queue: OperationQueue?)static get shared(): URLSessionSwift declarationclass var shared: URLSession { get }dataTaskWith(request: URLRequest): URLSessionDataTaskSwift declarationfunc dataTask(with request: URLRequest) -> URLSessionDataTaskdataTaskWithCompletionHandler(request: URLRequest, completionHandler: ((arg0: (ArrayBuffer) | null, arg1: (URLResponse) | null, arg2: (NativeError) | null) => void)): URLSessionDataTaskSwift declarationfunc dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionDataTaskdataTaskWith52518(url: string): URLSessionDataTaskSwift declarationfunc dataTask(with url: URL) -> URLSessionDataTaskdataTaskWithCompletionHandler56310(url: string, completionHandler: ((arg0: (ArrayBuffer) | null, arg1: (URLResponse) | null, arg2: (NativeError) | null) => void)): URLSessionDataTaskSwift declarationfunc dataTask(with url: URL, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionDataTaskdownloadTaskWith(request: URLRequest): URLSessionDownloadTaskSwift declarationfunc downloadTask(with request: URLRequest) -> URLSessionDownloadTaskdownloadTaskWithCompletionHandler(request: URLRequest, completionHandler: ((arg0: (string) | null, arg1: (URLResponse) | null, arg2: (NativeError) | null) => void)): URLSessionDownloadTaskSwift declarationfunc downloadTask(with request: URLRequest, completionHandler: @escaping @Sendable (URL?, URLResponse?, (any Error)?) -> Void) -> URLSessionDownloadTaskdownloadTaskWithResumeData(resumeData: ArrayBuffer): URLSessionDownloadTaskSwift declarationfunc downloadTask(withResumeData resumeData: Data) -> URLSessionDownloadTaskdownloadTaskWithResumeDataCompletionHandler(resumeData: ArrayBuffer, completionHandler: ((arg0: (string) | null, arg1: (URLResponse) | null, arg2: (NativeError) | null) => void)): URLSessionDownloadTaskSwift declarationfunc downloadTask(withResumeData resumeData: Data, completionHandler: @escaping @Sendable (URL?, URLResponse?, (any Error)?) -> Void) -> URLSessionDownloadTaskdownloadTaskWith32742(url: string): URLSessionDownloadTaskSwift declarationfunc downloadTask(with url: URL) -> URLSessionDownloadTaskdownloadTaskWithCompletionHandler24406(url: string, completionHandler: ((arg0: (string) | null, arg1: (URLResponse) | null, arg2: (NativeError) | null) => void)): URLSessionDownloadTaskSwift declarationfunc downloadTask(with url: URL, completionHandler: @escaping @Sendable (URL?, URLResponse?, (any Error)?) -> Void) -> URLSessionDownloadTaskfinishTasksAndInvalidate(): voidSwift declarationfunc finishTasksAndInvalidate()flush(completionHandler: (() => void)): voidSwift declarationfunc flush() asyncgetAllTasks(completionHandler: ((arg0: Array<URLSessionTask>) => void)): voidSwift declarationvar allTasks: [URLSessionTask] { get async }getTasksWithCompletionHandler(completionHandler: ((arg0: Array<URLSessionDataTask>, arg1: Array<URLSessionUploadTask>, arg2: Array<URLSessionDownloadTask>) => void)): voidSwift declarationvar tasks: ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) { get async }static init(): URLSessionSwift declarationinit()invalidateAndCancel(): voidSwift declarationfunc invalidateAndCancel()reset(completionHandler: (() => void)): voidSwift declarationfunc reset() asyncstreamTaskWithHostNamePort(hostname: string, port: number): URLSessionStreamTaskSwift declarationfunc streamTask(withHostName hostname: String, port: Int) -> URLSessionStreamTaskstreamTaskWith(service: NetService): URLSessionStreamTaskSwift declarationfunc streamTask(with service: NetService) -> URLSessionStreamTaskuploadTaskWithFrom(request: URLRequest, bodyData: ArrayBuffer): URLSessionUploadTaskSwift declarationfunc uploadTask(with request: URLRequest, from bodyData: Data) -> URLSessionUploadTaskuploadTaskWithFromCompletionHandler(request: URLRequest, bodyData: (ArrayBuffer) | null, completionHandler: ((arg0: (ArrayBuffer) | null, arg1: (URLResponse) | null, arg2: (NativeError) | null) => void)): URLSessionUploadTaskSwift declarationfunc uploadTask(with request: URLRequest, from bodyData: Data?, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTaskuploadTaskWithFromFile(request: URLRequest, fileURL: string): URLSessionUploadTaskSwift declarationfunc uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTaskuploadTaskWithFromFileCompletionHandler(request: URLRequest, fileURL: string, completionHandler: ((arg0: (ArrayBuffer) | null, arg1: (URLResponse) | null, arg2: (NativeError) | null) => void)): URLSessionUploadTaskSwift declarationfunc uploadTask(with request: URLRequest, fromFile fileURL: URL, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTaskuploadTaskWithResumeData(resumeData: ArrayBuffer): URLSessionUploadTaskSwift declarationfunc uploadTask(withResumeData resumeData: Data) -> URLSessionUploadTaskuploadTaskWithResumeDataCompletionHandler(resumeData: ArrayBuffer, completionHandler: ((arg0: (ArrayBuffer) | null, arg1: (URLResponse) | null, arg2: (NativeError) | null) => void)): URLSessionUploadTaskSwift declarationfunc uploadTask(withResumeData resumeData: Data, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTaskuploadTaskWithStreamedRequest(request: URLRequest): URLSessionUploadTaskSwift declarationfunc uploadTask(withStreamedRequest request: URLRequest) -> URLSessionUploadTaskwebSocketTaskWith(request: URLRequest): URLSessionWebSocketTaskSwift declarationfunc webSocketTask(with request: URLRequest) -> URLSessionWebSocketTaskwebSocketTaskWith14765(url: string): URLSessionWebSocketTaskSwift declarationfunc webSocketTask(with url: URL) -> URLSessionWebSocketTaskwebSocketTaskWithProtocols(url: string, protocols: Array<string>): URLSessionWebSocketTaskSwift declarationfunc webSocketTask(with url: URL, protocols: [String]) -> URLSessionWebSocketTaskget configuration(): URLSessionConfigurationSwift declaration@NSCopying var configuration: URLSessionConfiguration { get }get delegate(): (SDKHandle) | nullSwift declarationvar delegate: (any URLSessionDelegate)? { get }get delegateQueue(): OperationQueueSwift declarationvar delegateQueue: OperationQueue { get }get sessionDescription(): (string) | nullSwift declarationvar sessionDescription: String? { get set }set sessionDescription(value: (string) | null)Swift declarationvar sessionDescription: String? { get set }dataTaskPublisherFor(request: URLRequest): URLSession_DataTaskPublisherSwift declarationfunc dataTaskPublisher(for request: URLRequest) -> URLSession.DataTaskPublisherReturns a publisher that wraps a URL session data task for a given URL request. The publisher publishes data when the task completes, or terminates if the task fails with an error. - Parameter request: The URL request for which to create a data task. - Returns: A publisher that wraps a data task for the URL request.
dataTaskPublisherFor33509(url: string): URLSession_DataTaskPublisherSwift declarationfunc dataTaskPublisher(for url: URL) -> URLSession.DataTaskPublisherReturns a publisher that wraps a URL session data task for a given URL. The publisher publishes data when the task completes, or terminates if the task fails with an error. - Parameter url: The URL for which to create a data task. - Returns: A publisher that wraps a data task for the URL.
dataForDelegate(request: URLRequest, delegate?: (Implements<URLSessionTaskDelegate> | SDKHandle) | null): Promise<[ArrayBuffer, URLResponse]>Swift declarationfunc data(for request: URLRequest, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (Data, URLResponse)Convenience method to load data using a URLRequest, creates and resumes a URLSessionDataTask internally. - Parameter request: The URLRequest for which to load data. - Parameter delegate: Task-specific delegate. - Returns: Data and response.
dataFor(request: URLRequest): Promise<[ArrayBuffer, URLResponse]>Swift declarationfunc data(for request: URLRequest) async throws -> (Data, URLResponse)Convenience method to load data using a URLRequest, creates and resumes a URLSessionDataTask internally. - Parameter request: The URLRequest for which to load data. - Returns: Data and response.
dataFromDelegate(url: string, delegate?: (Implements<URLSessionTaskDelegate> | SDKHandle) | null): Promise<[ArrayBuffer, URLResponse]>Swift declarationfunc data(from url: URL, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (Data, URLResponse)Convenience method to load data using a URL, creates and resumes a URLSessionDataTask internally. - Parameter url: The URL for which to load data. - Parameter delegate: Task-specific delegate. - Returns: Data and response.
dataFrom(url: string): Promise<[ArrayBuffer, URLResponse]>Swift declarationfunc data(from url: URL) async throws -> (Data, URLResponse)Convenience method to load data using a URL, creates and resumes a URLSessionDataTask internally. - Parameter url: The URL for which to load data. - Returns: Data and response.
bytesForDelegate(request: URLRequest, delegate?: (Implements<URLSessionTaskDelegate> | SDKHandle) | null): Promise<[URLSession_AsyncBytes, URLResponse]>Swift declarationfunc bytes(for request: URLRequest, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (URLSession.AsyncBytes, URLResponse)Returns a byte stream that conforms to AsyncSequence protocol. - Parameter request: The URLRequest for which to load data. - Parameter delegate: Task-specific delegate. - Returns: Data stream and response.
bytesFromDelegate(url: string, delegate?: (Implements<URLSessionTaskDelegate> | SDKHandle) | null): Promise<[URLSession_AsyncBytes, URLResponse]>Swift declarationfunc bytes(from url: URL, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (URLSession.AsyncBytes, URLResponse)Returns a byte stream that conforms to AsyncSequence protocol. - Parameter url: The URL for which to load data. - Parameter delegate: Task-specific delegate. - Returns: Data stream and response.
uploadForFromDelegate(request: URLRequest, bodyData: ArrayBuffer, delegate?: (Implements<URLSessionTaskDelegate> | SDKHandle) | null): Promise<[ArrayBuffer, URLResponse]>Swift declarationfunc upload(for request: URLRequest, from bodyData: Data, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (Data, URLResponse)Convenience method to upload data using a URLRequest, creates and resumes a URLSessionUploadTask internally. - Parameter request: The URLRequest for which to upload data. - Parameter bodyData: Data to upload. - Parameter delegate: Task-specific delegate. - Returns: Data and response.
uploadForFrom(request: URLRequest, bodyData: ArrayBuffer): Promise<[ArrayBuffer, URLResponse]>Swift declarationfunc upload(for request: URLRequest, from bodyData: Data) async throws -> (Data, URLResponse)Convenience method to upload data using a URLRequest, creates and resumes a URLSessionUploadTask internally. - Parameter request: The URLRequest for which to upload data. - Parameter bodyData: Data to upload. - Returns: Data and response.
uploadForFromFileDelegate(request: URLRequest, fileURL: string, delegate?: (Implements<URLSessionTaskDelegate> | SDKHandle) | null): Promise<[ArrayBuffer, URLResponse]>Swift declarationfunc upload(for request: URLRequest, fromFile fileURL: URL, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (Data, URLResponse)Convenience method to upload data using a URLRequest, creates and resumes a URLSessionUploadTask internally. - Parameter request: The URLRequest for which to upload data. - Parameter fileURL: File to upload. - Parameter delegate: Task-specific delegate. - Returns: Data and response.
uploadForFromFile(request: URLRequest, fileURL: string): Promise<[ArrayBuffer, URLResponse]>Swift declarationfunc upload(for request: URLRequest, fromFile fileURL: URL) async throws -> (Data, URLResponse)Convenience method to upload data using a URLRequest, creates and resumes a URLSessionUploadTask internally. - Parameter request: The URLRequest for which to upload data. - Parameter fileURL: File to upload. - Returns: Data and response.
downloadResumeFromDelegate(resumeData: ArrayBuffer, delegate?: (Implements<URLSessionTaskDelegate> | SDKHandle) | null): Promise<[string, URLResponse]>Swift declarationfunc download(resumeFrom resumeData: Data, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (URL, URLResponse)Convenience method to resume download, creates and resumes a URLSessionDownloadTask internally. - Parameter resumeData: Resume data from an incomplete download. - Parameter delegate: Task-specific delegate. - Returns: Downloaded file URL and response. The file will not be removed automatically.
downloadForDelegate(request: URLRequest, delegate?: (Implements<URLSessionTaskDelegate> | SDKHandle) | null): Promise<[string, URLResponse]>Swift declarationfunc download(for request: URLRequest, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (URL, URLResponse)Convenience method to download using a URLRequest, creates and resumes a URLSessionDownloadTask internally. - Parameter request: The URLRequest for which to download. - Parameter delegate: Task-specific delegate. - Returns: Downloaded file URL and response. The file will not be removed automatically.
downloadFromDelegate(url: string, delegate?: (Implements<URLSessionTaskDelegate> | SDKHandle) | null): Promise<[string, URLResponse]>Swift declarationfunc download(from url: URL, delegate: (any URLSessionTaskDelegate)? = nil) async throws -> (URL, URLResponse)Convenience method to download using a URL, creates and resumes a URLSessionDownloadTask internally. - Parameter url: The URL for which to download. - Parameter delegate: Task-specific delegate. - Returns: Downloaded file URL and response. The file will not be removed automatically.
No declarations were skipped in this snapshot.