Why wouldn't you just use libcurl and do it all from one program?