Skip to content

easy.get_info<CURLINFO_CONTENT_TYPE>(); not a std::pair #156

Description

@aboelens

In one of the examples it is mentioned that:

/**

  • get_info returns a curl_easy_info object. With the get method we retrieve
  • the std::pair object associated with it: the first item is the return code of the
  • request. The second is the element requested by the specified libcurl macro.
    */

However, the type of I get is:

auto x = easy_.get_info<CURLINFO_CONTENT_TYPE>();
std::cout << "Type of x: " << typeid(x.get()).name() << std::endl;

Type of x: class std::basic_string<char,struct std::char_traits,class std::allocator >

instead of a std::pair. How do I get just the element requested?

Thanks,

Arnout

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions