restclient-cpp icon indicating copy to clipboard operation
restclient-cpp copied to clipboard

RestClient::Response reassignment is null

Open jmdaemon opened this issue 3 years ago • 0 comments

Example Code

// Setup
std::string url = ""; // your url here
std::string query = "/get"; // your endpoint
RestClient::Connection* con = new RestClient::Connection(url);

// Testing
RestClient::Response res = new RestClient::Response();
res = con->get(query); // This reassignment does not work, res is still null
std::cout << res.body << std::endl; // Nothing

auto actual = con->get(query); // This works
std::cout << actual.body << std::endl;

Expected Behavior

This reassignment should "just work" as intended.

jmdaemon avatar Aug 23 '22 19:08 jmdaemon