From: Allister L. S. <all...@gm...> - 2008-08-13 06:24:14
|
Hi, Sorry I've been silent due to a rather busy work week. But this Friday's a holiday in France (yehey!) so I'm thinking of working on the MIME part over the 3-day weekend. I've no clear idea how to do it yet, but it should be a good learning experience. Till this weekend, cheers! Allister On Wed, Aug 13, 2008 at 6:45 AM, Dean Michael Berris <mik...@gm... > wrote: > > Like I implied, if it has something to do with MIME, we need to write > that library outside of HTTP. An imaginary MIME library would expose a > stream interface, and perhaps provide the following: > > <code> > > using namespace boost::network::mime; > omimestream multi_part_builder; > multi_part_builder > << content( > disposition( > "form-data", > make_tuple( > make_pair("name", "param1") > ) > ), > data("param1Value") > ) > << content( > disposition( > "file", > make_tuple( > make_pair("name", "file"), > make_pair("filename", "filename1.txt") > ) > ), > type( > "text/plain" > ), > data(file_stream) > ; > > ... > client_.post(request, multi_part_builder.type(), > multi_part_builder.body()); > > </code> > > This allows us to use the MIME library outside of HTTP and be a usable > library in itself. In this case, the decoupling of the MIME handling > from the HTTP implementation will be a good thing. > > I'm not saying it shouldn't be our responsibility -- I agree that we > should make it easier for users -- but how we're going to allow that > to happen has to fit within the goals of the project, which is > building a set of extensible components for building network-aware > applications in C++. > > I can write that MIME builder interface with Boost.Proto or from > scratch, but that would require me to context-switch from the HTTP > implementation. > > If anybody's interested in picking up that piece of the puzzle, or > would like to be part of the discussion about it, now would be a good > time to sound off. :D > > > |