Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. const std = @import("std");
  2. const warn = std.debug.warn;
  3.  
  4. const c = @cImport({
  5. @cInclude("curl/curl.h");
  6. });
  7.  
  8. pub fn main() void {
  9. const curl = c.curl_easy_init();
  10. var res: c.CURLcode = undefined;
  11. _ = c.curl_easy_setopt(curl, @intToEnum(c.CURLoption, c.CURLOPT_URL), c"http://example.com");
  12. res = c.curl_easy_perform(curl);
  13. c.curl_easy_cleanup(curl);
  14. warn("{}\n", res);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement