Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/HTTP/PureBasic/http-1.basic
Normal file
17
Task/HTTP/PureBasic/http-1.basic
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
InitNetwork()
|
||||
OpenConsole()
|
||||
|
||||
tmpdir$ = GetTemporaryDirectory()
|
||||
filename$ = tmpdir$ + "PB_tempfile" + Str(Random(200000)) + ".html"
|
||||
|
||||
If ReceiveHTTPFile("http://rosettacode.org/wiki/Main_Page", filename$)
|
||||
If ReadFile(1, filename$)
|
||||
Repeat
|
||||
PrintN(ReadString(1))
|
||||
Until Eof(1)
|
||||
Input()
|
||||
; to prevent console from closing if on windows
|
||||
CloseFile(1)
|
||||
EndIf
|
||||
DeleteFile(filename$)
|
||||
EndIf
|
||||
14
Task/HTTP/PureBasic/http-2.basic
Normal file
14
Task/HTTP/PureBasic/http-2.basic
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
InitNetwork()
|
||||
OpenConsole()
|
||||
id = OpenNetworkConnection("rosettacode.org", 80)
|
||||
SendNetworkString(id, "GET /wiki/Main_Page HTTP/1.1" + Chr(10) + "Host: rosettacode.org" + Chr(10) + Chr(10))
|
||||
Repeat
|
||||
If NetworkClientEvent(id) = 2
|
||||
a$ = Space(1000)
|
||||
ReceiveNetworkData(id, @a$, 1000)
|
||||
out$ + a$
|
||||
EndIf
|
||||
Until FindString(out$, "</html>", 0)
|
||||
PrintN(out$)
|
||||
; next line only to prevent console from closing on Windows
|
||||
Input()
|
||||
Loading…
Add table
Add a link
Reference in a new issue