File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -208,10 +208,15 @@ in order to initialize the certificate bundle.
208208For example:
209209
210210``` swift
211- import FoundationNetworking
211+ import Foundation
212+ #if os (Android )
212213import AndroidNative
214+ import FoundationNetworking
215+ #endif
213216
217+ #if os (Android )
214218try AndroidBootstrap.setupCACerts () // needed in order to use https
219+ #endif
215220let url = URL (string : " https://httpbin.org/get?x=1" )!
216221let (data, response) = try await URLSession.shared .data (from : url)
217222```
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ class AndroidNativeTests : XCTestCase {
1515 var origin : String ?
1616 var url : String ?
1717 }
18+ #if os(Android)
1819 try AndroidBootstrap . setupCACerts ( ) // needed in order to use https
20+ #endif
1921 let url = URL ( string: " https://httpbin.org/get?x=1 " ) !
2022 let ( data, response) = try await URLSession . shared. data ( from: url)
2123 let statusCode = ( response as? HTTPURLResponse ) ? . statusCode
You can’t perform that action at this time.
0 commit comments