urlRequest
TypeScriptget urlRequest(): _Foundation_URLRequestSwift declarationlet urlRequest: URLRequestThe URL request for the data request.
struct · iOS 15.0+ · SDK 27.1
struct MusicDataRequestA request for loading data from an arbitrary Apple Music API endpoint.
get urlRequest(): _Foundation_URLRequestSwift declarationlet urlRequest: URLRequestThe URL request for the data request.
static init(urlRequest: _Foundation_URLRequest): MusicDataRequestSwift declarationinit(urlRequest: URLRequest)Creates a data request with a URL request.
get description(): stringSwift declarationvar description: String { get }A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.
static get tokenProvider(): (MusicUserTokenProvider) & (SDKHandle)Swift declarationstatic var tokenProvider: any MusicUserTokenProvider & MusicDeveloperTokenProviderThe shared token provider for fetching tokens that Apple Music API requires.
static set tokenProvider(value: (MusicUserTokenProvider) & (Implements<MusicDeveloperTokenProvider> | SDKHandle))Swift declarationstatic var tokenProvider: any MusicUserTokenProvider & MusicDeveloperTokenProviderThe shared token provider for fetching tokens that Apple Music API requires.
static get currentCountryCode(): Promise<string>Swift declarationstatic var currentCountryCode: String { get async throws }Fetches the current country code for the user’s Apple Music account. The current country code may be useful to construct the URL for a ``MusicDataRequest`` because a typical catalog endpoint for Apple Music API requires the inclusion of a country code in the path of the corresponding URL.
response(): Promise<MusicDataResponse>Swift declarationfunc response() async throws -> MusicDataResponseFetches data from the Apple Music API endpoint that the URL request defines.
No declarations were skipped in this snapshot.