GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Reusing the response object · Issue #772 · cpp-netlib/cpp-netlib Closed DescriptionI am implementing the follow_redirects using the async_client and when I reuse the same response object, the body is updated but not the headers. Sample: int main() { std::string url = "http://google.com"; async_client::options options; options .follow_redirects(true) .cache_resolved(true) .always_verify_peer(false) ; async_client client(options); async_client::request req(url); auto response = client.get(req)); while (!ready(response)); // we get the expected headers and body auto hdrs = headers(response); for (auto &h : hdrs) { LOG(INFO) << h.first << ": " << h.second; } LOG(INFO) << body(response); LOG(INFO) << "-----------------"; req.uri("http://example.com"); // changing the url response = client.get(req)); while (!ready(response)); // here the headers are the same as the previous response, they should be those from example.com auto hdrs2 = headers(response); for (auto &h : hdrs2) { LOG(INFO) << h.first << ": " << h.second; } // the body is the body of example.com LOG(INFO) << body(response); } I tried the swap method without success. Is there an explication or is it a bug ? If this is normal it should probably be explained in the documentation. Also I had a similar problem with the request object (operator= didn't work), but using the swap method I made it working. Thanks! Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |