LibCXX是一个C++类库,提供了高级的应用框架类和一些Linux专有的特性封装。
上传文件示例代码:
autoresp=ua->request(x::http::POST,"https://localhost/cgi-bin/req.pl",x::http::form::parameters::create("username","alfred","password","rosebud"),"UTF-8","file",x::fd::open("upload.txt"),"text/plain;charset=iso-8859-1","dailyfile.txt");Cookie处理代码:#include<x/http/cookiejar.H>x::http::useragentua(x::http::useragent::create());try{ua->jar()->load("cookies.txt");}catch(constx::exception&e){}//...ua->jar()->save("cookies.txt");
评论