Files
c3c/resources/examples/notworking/http.c3
2023-09-05 14:36:17 +02:00

25 lines
414 B
C

import curl;
fn int main(void)
{
Curl curl;
if (catch e = curl.init())
{
io::printfn("Failed to create new curl: %s\n", e);
exit(FAILURE);
}
curl.setopt(URL, "http://www.rosettacode.org/");
curl.setopt(FOLLOWLOCATION, 1);
if (catch err = curl.perform())
{
io::printfn("Error making request: %s\n", e);
exit(FAILURE);
}
exit(SUCCESS);
}