From: Glyn M. <gly...@gm...> - 2008-08-30 10:39:05
|
Hi Agustin, Sorry I didn't get round to this sooner. 2008/8/29 Agustín K-ballo Bergé <kab...@ho...> > > According to RFC2616, "A request message from a client to a server > includes, within the first line of that message, the method to be > applied to the resource, (...)". I would like to see a clear > compile-time mapping for the objects, just as I like them for HTTP > 'methods'. Perhaps something like this: > > using namespace boost::network; > http::resource resource("http://www.boost.org/"); > http::request request_; > http::client client_; > http::response response_; > request_ = http::get(resource); > response_ = client_.request(request_); > > IMHO, not only the code looks closer to the protocol, but also detaches > it from the underlaying transport mechanism (client_ here). It may just > be that this is not what the library seeks for. > The http::resource here would be equivalent to something like an URI builder, I think. Otherwise I don't know what you would gain from having a free http::get function rather than making it a member of client. I would expect http::get to actually make a request, rather than construct a request object. My original concern was that the request function(s) were members of class named "client" and I don't any difference here. Glyn |