2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,3 +1,7 @@
|
|||
Print an HTTPS URL's content to the console. Checking the host certificate for validity is recommended. The client should not authenticate itself to the server — the webpage https://sourceforge.net/ supports that access policy — as that is the subject of other [[HTTPS request with authentication|tasks]].
|
||||
;Task:
|
||||
Print an HTTPS URL's content to the console. Checking the host certificate for validity is recommended.
|
||||
|
||||
The client should not authenticate itself to the server — the webpage https://sourceforge.net/ supports that access policy — as that is the subject of other [[HTTPS request with authentication|tasks]].
|
||||
|
||||
Readers may wish to contrast with the [[HTTP Request]] task, and also the task on [[HTTPS request with authentication]].
|
||||
<br><br>
|
||||
|
|
|
|||
17
Task/HTTPS/Fortran/https.f
Normal file
17
Task/HTTPS/Fortran/https.f
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
program https_example
|
||||
implicit none
|
||||
character (len=:), allocatable :: code
|
||||
character (len=:), allocatable :: command
|
||||
logical:: waitForProcess
|
||||
|
||||
! execute Node.js code
|
||||
code = "var https = require('https'); &
|
||||
https.get('https://sourceforge.net/', function(res) {&
|
||||
console.log('statusCode: ', res.statusCode);&
|
||||
console.log('Is authorized:' + res.socket.authorized);&
|
||||
console.log(res.socket.getPeerCertificate());&
|
||||
res.on('data', function(d) {process.stdout.write(d);});});"
|
||||
|
||||
command = 'node -e "' // code // '"'
|
||||
call execute_command_line (command, wait=waitForProcess)
|
||||
end program https_example
|
||||
|
|
@ -8,7 +8,7 @@ http.use_ssl = true
|
|||
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||
|
||||
http.start do
|
||||
content = http.get("/")
|
||||
content = http.get(uri)
|
||||
p [content.code, content.message]
|
||||
pp content.to_hash
|
||||
puts content.body
|
||||
|
|
|
|||
7
Task/HTTPS/Unicon/https.unicon
Normal file
7
Task/HTTPS/Unicon/https.unicon
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Requires Unicon version 13
|
||||
procedure main(arglist)
|
||||
url := (\arglist[1] | "https://sourceforge.net/")
|
||||
w := open(url, "m-") | stop("Cannot open " || url)
|
||||
while write(read(w))
|
||||
close(w)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue