should be reliable (the current method isn't, as proven by issue #12 ) - got the idea from http://php.net/manual/en/function.curl-setopt.php#118967