#curlpp setting method to HEAD

4 messages · Page 1 of 1 (latest)

silent wren
#

libc++abi: terminating due to uncaught exception of type curlpp::UnsetOption: You are trying to retreive the value of an unset option

        for (const std::string &url : urls) {
            auto elem = std::make_unique<std::tuple<std::ostringstream, curlpp::Easy>>();
            curlpp::Easy &request = std::get<1>(*elem);
            request.setOpt(curlpp::options::Url(url));
            switch (method) {
                case HTTPMethod::GET:
                    request.setOpt(curlpp::options::HttpGet(true));
                    break;
                case HTTPMethod::POST:
                    request.setOpt(curlpp::options::HttpPost());
                    break;
                case HTTPMethod::HEAD:
                    request.setOpt(curlpp::options::HttpHeader());
                    break;
            }

            request.setOpt(curlpp::options::WriteStream(&std::get<0>(*elem)));

            requests.push_back(std::move(elem));
        }
``` the offending code is 

```cpp
                case HTTPMethod::HEAD:
                    request.setOpt(curlpp::options::HttpHeader());
                    break;
``` but I think the rest should also break


anyone got clues?
viral hazelBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

silent wren
#

It has come to my attention that I am incredibly stupid

#

!solved