예제 #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;
}
예제 #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);
}