4
my golang libcurl(curl) binding.
6
See more examples in ./examples/ directory~!
11
go-curl is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).
13
Current Development Statue
14
--------------------------
17
* READ, WRITE, HEADER, PROGRESS function callback
18
* a Multipart Form supports file uploading
19
* Most curl_easy_setopt option
20
* partly implement share & multi interface
21
* new callback function prototype
26
Make Sure You Have libcurl (and its develop headers, static/dynamic libs) installed!
29
$ go get -u github.com/andelf/go-curl
35
* passed go1 (ArchLinux)
37
* passed go1 (win7, mingw-gcc 4.5.2, curl 7.22.0)
39
* passed go1 (Mac OS X 10.7.3, curl 7.21.4)
49
curl "github.com/andelf/go-curl"
53
easy := curl.EasyInit()
56
easy.Setopt(curl.OPT_URL, "http://www.baidu.com/")
58
// make a callback function
59
fooTest := func (buf []byte, userdata interface{}) bool {
60
println("DEBUG: size=>", len(buf))
61
println("DEBUG: content=>", string(buf))
65
easy.Setopt(curl.OPT_WRITEFUNCTION, fooTest)
67
if err := easy.Perform(); err != nil {
68
fmt.Printf("ERROR: %v\n", err)