HTTPS/Authenticated: Difference between revisions

Content added Content deleted
m (Added language identifier.)
m (→‎{{header|Wren}}: Minor tidy)
Line 756: Line 756:
{{libheader|libcurl}}
{{libheader|libcurl}}
An embedded program so we can ask the C host to communicate with libcurl for us.
An embedded program so we can ask the C host to communicate with libcurl for us.
<syntaxhighlight lang="ecmascript">/* https_authenticated.wren */
<syntaxhighlight lang="wren">/* HTTPS_authenticated.wren */


var CURLOPT_URL = 10002
var CURLOPT_URL = 10002
Line 789: Line 789:
<br>
<br>
We now embed this in the following C program, compile and run it.
We now embed this in the following C program, compile and run it.
<syntaxhighlight lang="c">/* gcc https_authenticated.c -o https_authenticated -lcurl -lwren -lm */
<syntaxhighlight lang="c">/* gcc HTTPS_authenticated.c -o HTTPS_authenticated -lcurl -lwren -lm */


#include <stdio.h>
#include <stdio.h>
Line 899: Line 899:
WrenVM* vm = wrenNewVM(&config);
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* module = "main";
const char* fileName = "https_authenticated.wren";
const char* fileName = "HTTPS_authenticated.wren";
char *script = readFile(fileName);
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
WrenInterpretResult result = wrenInterpret(vm, module, script);