HTTPS: Difference between revisions
m
→{{header|Wren}}: Minor tidy
imported>Gabrielsroka |
m (→{{header|Wren}}: Minor tidy) |
||
(One intermediate revision by one other user not shown) | |||
Line 860:
=={{header|Sidef}}==
<syntaxhighlight lang="ruby">
require('LWP::Protocol::https')
var url = 'https://rosettacode.org';▼
func get(url) {
static ua = %O<LWP::UserAgent>.new(
ssl_opts => Hash
)
if (resp.is_success) {
return resp.decoded_content
}
}
▲var resp = ua.get(url);
▲resp.is_success || die "Failed to GET #{url.dump}: #{resp.status_line}";
=={{header|Swift}}==
Line 989 ⟶ 994:
{{libheader|libcurl}}
An embedded program so we can ask the C host to communicate with libcurl for us.
<syntaxhighlight lang="
var CURLOPT_URL = 10002
Line 1,022 ⟶ 1,027:
<br>
We now embed this in the following C program, compile and run it.
<syntaxhighlight lang="c">/* gcc
#include <stdio.h>
Line 1,132 ⟶ 1,137:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
|