Anonymous user
HTTPS: Difference between revisions
m
→{{header|BaCon}}
Line 37:
=={{header|BaCon}}==
<lang freebasic>
OPEN website$ & ":443" FOR NETWORK AS mynet▼
RECEIVE dat$ FROM mynet
IF REGEX(dat$, "\r\n\r\n$") THEN BREAK : ' Quit receiving data when end indicator was reached
WEND
▲CONST req$ = "GET / HTTP/1.1\r\nHost: " & TOKEN$(website$, 1, ":") & "\r\n\r\n"
▲ website$ = "www.google.com:443"
▲OPEN website$ FOR NETWORK AS mynet
▲ total$ = total$ & buf$
▲UNTIL ISFALSE(WAIT(mynet, 500))
CLOSE NETWORK mynet
PRINT REPLACE$(total$, "\r\n[0-9a-fA-F]+\r\n", "\r\n", TRUE) : ' Remove chunk indicators from HTML data
</lang>
|