HTTP: Difference between revisions

Undo revision 315455 by WdeCvfYlmB (talk)
(Undo revision 315456 by WdeCvfYlmB (talk))
(Undo revision 315455 by WdeCvfYlmB (talk))
Line 1,110:
 
=={{header|Kotlin}}==
<lang scala>import// javaversion 1.net1.URL2
 
import java.net.URL
import java.io.InputStreamReader
import java.util.Scanner
 
fun main(args: Array<String>) {
val url = URL("http://www.w3puzzlers.org/Homepub/wordlists/unixdict.htmltxt")
val isr = InputStreamReader(url.openStream())
val sc = Scanner(isr)
while (sc.hasNextLine()) println(sc.nextLine())
println(sc.nextLine())
sc.close()
}</lang>
Line 1,124 ⟶ 1,126:
=={{header|Lasso}}==
incude_url is a wrapper for Lasso's curl datatype, however it can be achieved in several ways.
<langUsing Lasso>// usingthe include_url wrapper:.
<lang Lasso>include_url('http://rosettacodewww.w3.org/indexHome.html')</lang>
// oneOne line curl.
 
<lang Lasso>curl('http://rosettacodewww.w3.org/indexHome.html')->result->asString</lang>
// one line curl
// usingUsing curl for more complex operations and feedback.
curl('http://rosettacode.org/index')->result->asString
<lang Lasso>local(x = curl('http://rosettacodewww.w3.org/indexHome.html'))
 
// using curl for more complex operations and feedback
local(x = curl('http://rosettacode.org/index'))
local(y = #x->result)
#y->asString</lang>
10,333

edits