18 lines
407 B
Odin
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))
|
|
}
|
|
}
|
|
}
|