September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
14
Task/HTTPS/Kotlin/https.kotlin
Normal file
14
Task/HTTPS/Kotlin/https.kotlin
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// version 1.1.2
|
||||
import java.net.URL
|
||||
import javax.net.ssl.HttpsURLConnection
|
||||
import java.io.InputStreamReader
|
||||
import java.util.Scanner
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val url = URL("https://en.wikipedia.org/wiki/Main_Page")
|
||||
val connection = url.openConnection() as HttpsURLConnection
|
||||
val isr = InputStreamReader(connection.inputStream)
|
||||
val sc = Scanner(isr)
|
||||
while (sc.hasNextLine()) println(sc.nextLine())
|
||||
sc.close()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue