andelf / go-curl

golang curl(libcurl) binding.
Apache License 2.0
485 stars 131 forks source link

Return HTTP status #38

Closed jhnferraris closed 8 years ago

jhnferraris commented 8 years ago

Hello, I'm relatively new to Go and don't know on how to approach on debugging Go libraries.

My question is how do we log the HTTP Status (200, 400, 502) when using this library? The doc only shows how to get the response.

Thanks for the help!

jhnferraris commented 8 years ago

Update:

I saw this: Getinfo(info) method. How do you exactly use this?

Thanks!

andelf commented 8 years ago
        info, err := easy.Getinfo(curl.INFO_RESPONSE_CODE)
        if err == nil {
            print("code: ", info.(int))
        }
jhnferraris commented 8 years ago

Thanks!