I can't make cURLpp to work with the following simple example, it keeps telling me No URL set!
. Here is the simplified code:
curlpp::initialize(CURL_GLOBAL_ALL);
curlpp::Easy easyhandle;
easyhandle.setOpt(new curlpp::options::Url(std::string("http://example.com")));
easyhandle.perform();
curlpp::terminate();
If I try to get back the Url option with:
curlpp::options::Url o;
easyhandle.getOpt(o);
then the object o
seems perfectly fine:
o @0x7ffeefbfed78 curlpp::options::Url
[curlpp::Option<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >] @0x7ffeefbfed78 curlpp::Option<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >
[curlpp::OptionBase] @0x7ffeefbfed78 curlpp::OptionBase
mOption CURLOPT_URL (10002) CURLoption
mContainer @0x101837be0 curlpp::internal::OptionContainer<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >
mValue "http://example.com" curlpp::internal::OptionContainer<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::ValueType
[0] 'h' 104 0x68 char
[1] 't' 116 0x74 char
[2] 't' 116 0x74 char
[3] 'p' 112 0x70 char
[4] ':' 58 0x3a char
[5] '/' 47 0x2f char
[6] '/' 47 0x2f char
[7] 'e' 101 0x65 char
[8] 'x' 120 0x78 char
[9] 'a' 97 0x61 char
[10] 'm' 109 0x6d char
[11] 'p' 112 0x70 char
[12] 'l' 108 0x6c char
[13] 'e' 101 0x65 char
[14] '.' 46 0x2e char
[15] 'c' 99 0x63 char
[16] 'o' 111 0x6f char
[17] 'm' 109 0x6d char
My environment is:
- macOS Big Sur
- libcurlpp 0.8.1_1
- lib curl 7.80.0