init
This commit is contained in:
17
examples/basic.odin
Normal file
17
examples/basic.odin
Normal file
@@ -0,0 +1,17 @@
|
||||
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))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user