Skip to content

URLSession.shared.data not implemented in swift-corelibs-foundation #4733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
christianfo opened this issue Apr 11, 2023 · 3 comments
Open

Comments

@christianfo
Copy link

christianfo commented Apr 11, 2023

Using Swift version 5.8 and swift-corelibs-foundation, this code:

let url = URL(string: "https://www.example.com")!
let (data, response) = try await URLSession.shared.data(from: url)

does not compile and outputs the following error:
error: value of type 'URLSession' has no member 'data'

@compnerd
Copy link
Member

compnerd commented Apr 11, 2023

Function that is attempting to be used is documented at: https://developer.apple.com/documentation/foundation/urlsession/3767352-data

The async functions are currently unavailable on swift-corelibs-foundation.

@carlynorama
Copy link

Duplicate? - #3205

@DanielSincere
Copy link

Is there a workaround? I just finished a re-write to async/await

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants