Exemple #1
0
HttpRequest& Util::Request(const string& host, int port, const string& url) {
	HttpRequest* p = new HttpRequest();
	p->SetHost(host);
	p->SetIpPort(port);
	p->SetUrl(url);
	return *p;
}
Exemple #2
0
bool Util::Download(string host, string url, int port, string file) {
	HttpRequest request;

	Downloader downloader;
	downloader.SetFile(file);
	request.SetListener(&downloader);

	request.SetHost(host);
	request.SetIpPort(port);
	request.SetUrl(url);
	return request.Get(10);
}