This repository has been archived on 2025-09-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
libcurl-odin/examples/basic.odin
2025-09-16 18:42:43 -04:00

18 lines
407 B
Odin

package examples
import "core:fmt"
import curl "../"
main :: proc() {
hCurl := curl.easy_init()
defer curl.easy_cleanup(hCurl)
if hCurl != nil {
curl.easy_setopt(hCurl, .URL, "https://example.com")
curl.easy_setopt(hCurl, .FOLLOWLOCATION, true)
res := curl.easy_perform(hCurl)
if res != .OK {
fmt.eprintln(curl.easy_strerror(res))
}
}
}