Open Class Propertyswift 6.0.3FoundationNetworking
shared
class var shared: URLSession { get }
class var shared: URLSession { get }
import FoundationNetworking
class URLSession
init(configuration: URLSessionConfiguration)
init(configuration: URLSessionConfiguration, delegate: (any URLSessionDelegate)?, delegateQueue queue: OperationQueue?)
var configuration: URLSessionConfiguration { get }
var delegate: (any URLSessionDelegate)? { get }
var delegateQueue: OperationQueue { get }
var sessionDescription: String?
func 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.
func 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.
func dataTask(with url: URL) -> URLSessionDataTask
func dataTask(with request: URLRequest) -> URLSessionDataTask
func dataTask(with url: URL, completionHandler: @escaping (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionDataTask
func dataTask(with request: URLRequest, completionHandler: @escaping (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionDataTask
func 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.
func 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.
func downloadTask(with url: URL) -> URLSessionDownloadTask
func downloadTask(with request: URLRequest) -> URLSessionDownloadTask
func downloadTask(with url: URL, completionHandler: @escaping (URL?, URLResponse?, (any Error)?) -> Void) -> URLSessionDownloadTask
func downloadTask(with request: URLRequest, completionHandler: @escaping (URL?, URLResponse?, (any Error)?) -> Void) -> URLSessionDownloadTask
func downloadTask(withResumeData resumeData: Data) -> URLSessionDownloadTask
func downloadTask(withResumeData resumeData: Data, completionHandler: @escaping (URL?, URLResponse?, (any Error)?) -> Void) -> URLSessionDownloadTask
func finishTasksAndInvalidate()
func flush(completionHandler: @escaping () -> Void)
func getAllTasks(completionHandler: @escaping ([URLSessionTask]) -> Void)
func getTasksWithCompletionHandler(_ completionHandler: @escaping ([URLSessionDataTask], [URLSessionUploadTask], [URLSessionDownloadTask]) -> Void)
func invalidateAndCancel()
func reset(completionHandler: @escaping () -> Void)
func 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.
func 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.
func uploadTask(with request: URLRequest, from bodyData: Data) -> URLSessionUploadTask
func uploadTask(with request: URLRequest, from bodyData: Data?, completionHandler: @escaping (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTask
func uploadTask(with request: URLRequest, fromFile fileURL: URL) -> URLSessionUploadTask
func uploadTask(with request: URLRequest, fromFile fileURL: URL, completionHandler: @escaping (Data?, URLResponse?, (any Error)?) -> Void) -> URLSessionUploadTask
func uploadTask(withStreamedRequest request: URLRequest) -> URLSessionUploadTask
func webSocketTask(with url: URL) -> URLSessionWebSocketTask
func webSocketTask(with request: URLRequest) -> URLSessionWebSocketTask
func webSocketTask(with url: URL, protocols: [String]) -> URLSessionWebSocketTask
enum AuthChallengeDisposition
enum DelayedRequestDisposition
enum ResponseDisposition