HTTPS/Authenticated: Difference between revisions

Added BaCon version.
(PowerShell added)
(Added BaCon version.)
Line 22:
#Include COM.ahk
#Include COMinvokeDeep.ahk</lang>
 
=={{header|BaCon}}==
<lang bacon>OPTION TLS TRUE
 
CONST Connect_Timeout = 2000
website$ = "chiselapp.com"
username$ = "nobody"
password$ = "ignore"
 
OPEN website$ & ":443" FOR NETWORK AS connection
 
SEND "GET /user/bacon/repository/bacon/index HTTP/1.1\r\nHost: " & website$ & "\r\nAuthorization: Basic " & B64ENC$(username$ & ":" & password$) & "\r\n\r\n" TO connection
 
WHILE WAIT(connection, Connect_Timeout)
RECEIVE data$ FROM connection
total$ = total$ & data$
IF INSTR(data$, "</html>") THEN BREAK
WEND
 
CLOSE NETWORK connection
PRINT total$</lang>
 
=={{header|C}}==
Anonymous user