mirror of
https://github.com/apple/swift-http-types
synced 2026-11-26 04:57:48 +00:00
support swift 6 concurrency URLSession method
This commit is contained in:
1 parent
803ca5a172
commit
5caa54337a
1 file changed
+12
-1
@@ -44,7 +44,7 @@ private enum HTTPTypeConversionError: Error {
|
||||
|
||||
#endif
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6)
|
||||
|
||||
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
|
||||
extension URLSession {
|
||||
@@ -113,7 +113,14 @@ extension URLSession {
|
||||
}
|
||||
return (location, response)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
|
||||
|
||||
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
|
||||
extension URLSession {
|
||||
/// Returns a byte stream that conforms to AsyncSequence protocol.
|
||||
///
|
||||
/// - Parameter request: The `HTTPRequest` for which to load data.
|
||||
@@ -131,6 +138,10 @@ extension URLSession {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6)
|
||||
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
extension URLSession {
|
||||
/// Convenience method to load data using an `HTTPRequest`; creates and resumes a `URLSessionDataTask` internally.
|
||||
|
||||
Reference in new issue
Block a user