On Fri, 2018-07-06 at 08:31 -0700, Vinnie Falco via Boost-users wrote:
It will be more convenient as you don't need to trim them when you want to capture the field value.
You shouldn't have to do any trimming. basic_fields member functions and iterator value_type which return field values do so using a string_view, whose length excludes the trailing CRLF and also any colon and space. Callers should not assume the string is null-terminated, and work with the interface provided by string_view.
Okay, maybe I'm stupid or I don't understand something. I've done a simple request to google.fr and the http::response[field::location] still has CRLF even with the following code using value_type's value() function: if (res_.result() == status::moved_permanently) { const auto it = res_.find(field::location); if (it != res_.end()) cout << "new location: [" << it->value << "]" << std::endl; } The res_ object is a http::responsehttp::string_body, And once printed to the console I have: new location: [http://www.google.fr/ ] May I miss something from your original answer? Regards, -- David